C++ Logo

std-proposals

Advanced search

Re: Reserve good keywords for floating point types

From: Tony V E <tvaneerd_at_[hidden]>
Date: Tue, 15 Oct 2019 11:33:15 -0400
On Tue, Oct 15, 2019 at 11:20 AM Lyberta via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> Tony V E:
> > Citation needed.
> >
>
> From the newer draft:
>
> # Prior art
>
> ## Rust
>
> Rust has `f32` and `f64` types that are guaranteed to be `binary32` and
> `binary64` respectively.
>
> ## Go
>
> Go has `float32` and `float64` types that are guaranteed to be
> `binary32` and `binary64` respectively.
>
> ## Swift
>
> Swift has `Float` and `Double` types that are guaranteed to be
> `binary32` and `binary64` respectively.
>
> ## Java
>
> Java has `float` and `double` types that are guaranteed to be `binary32`
> and `binary64` respectively.
>
> ## C#
>
> C# has `float` and `double` types that are guaranteed to be `binary32`
> and `binary64` respectively.
>
>
>
> Why would other languages guarantee layout if layout doesn't matter much?
>
>
I don't know.

One answer would be that if layout matters _sometimes_, even just 1% of the
time, and you don't want different types for "layout not important" and
"layout is essential", then you are forced to go with "layout is
essential", even if it is not essential 99% of the time.


-- 
Be seeing you,
Tony

Received on 2019-10-15 10:35:41