|
Boost Testing : |
From: Kevin Wheatley (hxpro_at_[hidden])
Date: 2005-11-17 12:07:52
Robert Ramey wrote:
> BUT - I can't find any "official" to initialize a float/double to any of
> these
> values. They seem to be the result of operations and its certainly
> not obvious that all compilers would be on the same page here.
>
> Note that this same problem arises whenever a float/double is written/read
> to/from a stream in a way designed to be portable. So it must have come
> up before. What's the solution here?
don't know of a great solution but under IEEE class floats can't you
compute the numbers...
NaN = 0/0
+inf = +1/0
-inf = -1/0
+0 = 0/+1
-0 = 0/-1
etc.
A big hack of a cheat for sure :-)
Kevin
-- | Kevin Wheatley, Cinesite (Europe) Ltd | Nobody thinks this | | Senior Technology | My employer for certain | | And Network Systems Architect | Not even myself |