Boost logo

Boost :

Subject: Re: [boost] Specific-Width Floating-Point Typedefs
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2013-04-08 07:43:53


> -----Original Message-----
> From: Boost [mailto:boost-bounces_at_[hidden]] On Behalf Of Jan Hudec
> Sent: Wednesday, April 03, 2013 10:27 PM
> To: boost_at_[hidden]
> Subject: Re: [boost] Specific-Width Floating-Point Typedefs
>
> On Thu, Mar 28, 2013 at 13:58:21 +0100, Bjorn Reese wrote:
> > On 2013-03-28 13:28, Paul A. Bristow wrote:
> > >There has recently been some discussion on improving portability of programs using
floating-point.
> >
> > A common use case for fixed-length floats that you do not mention
> > explicitly in your document is the exchange of floats over binary
> > network protocols
>
> That adds requirement that they be IEEE 754 formats though. While I don't know platform using any
other
> format these days, I don't think C++ requires that just as it does not require two's complement
for signed
> integers.
>
> So there would have to be one set of typedefs for just size/precision and another for the IEEE 754
standard
> formats.

One could have both, but for simplicity, I think we only have IEEE 754 standard formats in mind
(including the extended formats to get 128 bits - and up?).

http://en.wikipedia.org/wiki/Extended_precision

http://en.wikipedia.org/wiki/Quadruple_precision

As you observe, hardly anyone is currently doing anything else,

http://stackoverflow.com/questions/2234468/do-any-real-world-cpus-not-use-ieee-754

so there is really no portability case.

It doesn't seem worth making the names longer to distinguish the two cases.

Paul

---
Paul A. Bristow,
Prizet Farmhouse, Kendal LA8 8AB  UK
+44 1539 561830  07714330204
pbristow_at_[hidden]

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk