C++ Logo

STD-PROPOSALS

Advanced search

Subject: Re: [std-proposals] default floating point
From: Thiago Macieira (thiago_at_[hidden])
Date: 2021-01-15 09:34:54


On Friday, 15 January 2021 02:15:11 PST Giuseppe D'Angelo via Std-Proposals
wrote:
> Qt has supported this for decades with a custom `qreal` type which is
> simply a typedef; at build time you can choose it to be float or double.
> (It used to default on double everywhere except on older ARM CPUs, where
> it was float. These days it's double everywhere.)

And the reason it's double everywhere now is because having a type differ that
meaningfully caused a lot of problems. Like long changing sizes according to
architecture, it's difficult to use it for serialisation and expect proper
cross-platform behaviour. This also caused applications to exhibit slight mis-
behaviour because no one tested on those CPUs/FPUs.

Finally, the days of single-precision being slower are gone with the Cortex-
A8, from the late 2000s.

Is this still a problem? Is it big enough to deserve a language or standard
library change? And how does it relate to the extended floating point type
support paper?

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DPG Cloud Engineering

STD-PROPOSALS list run by std-proposals-owner@lists.isocpp.org

Standard Proposals Archives on Google Groups