C++ Logo

STD-PROPOSALS

Advanced search

Subject: Re: [std-proposals] Reserve good keywords for floating point types
From: Tony V E (tvaneerd_at_[hidden])
Date: 2019-10-15 10:21:47


On Tue, Oct 15, 2019 at 11:04 AM Lyberta via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> Thiago Macieira via Std-Proposals:
> > But for local data manipulation, that's not necessary. Take this simple
> > percentage calculation:
> >
> > cout << "Total complete: " << (count * 100. / total) << "%\n";
> >
> > There's no need to specify that this needs to be calculated using 53
> bits of
> > decimal precision instead of 52. We just need a good enough type that is
> fast
> > on the host machine.
>
> This would actually depend on the type of "count" and should be inside a
> template but end type will most likely have way more semantics.
>
> > It does if "float is binary" is the convention.
> >
> > - std::floatN_iec559_t is binaryN
> > - std::decimalN_iec559_t is decimalN
>
> I would like that convention if going for types with short names. With
> those long names it looks strange.
>
> I have found that "float_binaryN" identifiers are unused so I'm working
> on new draft that proposes those as a compromise.
>
> >> Again, flexible types are a relic of the past and only useful in
> >> extremely rare circumstances. Fixed layout is what's needed in 99% of
> cases.
> >
> > I disagree. Flexible types are useful in a lot more cases and fixing
> them to
> > specific layouts is needed only when interoperating with the world
> outside the
> > process.
> >
>
> There is strange logic. "Specific layouts are needed only when
> interoperating with the world". But, most software interoperates with
> world.
>
> I can think of only 2 cases when layout doesn't matter:
>
> * Hello world
> * Homework assignment
>
>

I do projection mapping. (Stitch together the output of N x M projectors
into a single image canvas.
https://www.google.com/search?q=projection+mapping&tbm=isch)

Doing all our calculations using doubles gives us more accuracy than your
eye can detect, float probably does as well actually.
We don't care about the format, we care that it is fast (even that doesn't
matter much, since you run the calculations once, then run the "light show"
for days or weeks based on the one calculation - if nothing moves!)

Before projection mapping, I've used floating point extensively for 25
years without caring about format. Maybe I misunderstand what you are
saying?

-- 
Be seeing you,
Tony


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

Standard Proposals Archives on Google Groups