Subject: Re: [std-proposals] default floating point
From: Giuseppe D'Angelo (giuseppe.dangelo_at_[hidden])
Date: 2021-01-15 04:15:11
Il 15/01/21 03:22, Vishal Oza via Std-Proposals ha scritto:
> I was thinking of adding a defaultÂ floating point type like int to the
> integerÂ type rather thanÂ assume that double is theÂ default. This might
> be better on older hardware where using a double mightÂ have a
> performance penalty. The keyword would either be flt or floating_point.
> I prefer flt for less typing but I can understandÂ that it could break
> existing code. Can anyone arue why this is a bad idea?
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.)
Do you need a _language_ solution?
-- Giuseppe D'Angelo | giuseppe.dangelo_at_[hidden] | Senior Software Engineer KDAB (France) S.A.S., a KDAB Group company Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com KDAB - The Qt, C++ and OpenGL Experts
STD-PROPOSALS list run by email@example.com
Standard Proposals Archives on Google Groups