Boost logo

Boost :

From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2001-04-23 10:08:57


Is the issue that a string ending with no letter MUST be a double,
one ending with F MUST be a float, and one ending with L must be
a long double,

AND if you want a type which doesn't match, then there is some
conversion and risk of rounding differences?

It is of course possible to generate the three constants

3.1459F
3.1459
3.1459L

at the expense of some fingertip wear, or cunning
macros BOOST joining.

I can't see how any conceivable representation
would have such a slight difference between types
so that rounding
from long double to double,
or long double to float
is ever going to be a problem.

But if you don't start with a long double 3.1459L
(All the values I have presented DO end with L)

then I can see you MAY get a reduction in accuracy,
in that this may be treated as a double.
(This was P J Plauger's advice).

Does the standard say anything about this?
(I have some trouble fully understanding it!)

Paul

> -----Original Message-----
> From: Peter Dimov [mailto:pdimov_at_[hidden]]
> Sent: Sunday, April 22, 2001 7:57 PM
> To: boost_at_[hidden]
> Subject: Re: [boost] Re: Boost.MathConstants: Review
>
>
> From: "David Abrahams" <abrahams_at_[hidden]>
>
> > If we believe Matt Austern's assertions about rounding, then it seems to
> me
> > that the numeric_limits-like template is essential, and it
> shouldn't just
> be
> > a wrapper over the abovve interface.
>
> Why? Doesn't implementation (3) in my original message,
>
> namespace boost
> {
> unsigned char _pi[] = { platform-dependent values here };
> double const & pi = *(double*)_pi;
> }
>
> address the rounding issue?
>
> --
> Peter Dimov
> Multi Media Ltd.
>
>
> To unsubscribe, send email to: <mailto:boost-unsubscribe_at_[hidden]>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>


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