|
 |
"Bald Eagle" <cre### [at] netscape net> wrote:
> Works pretty nice! :)
>
> Any way to force str to prepend the + sign to +inf?
>
> val ("+inf") = inf
> val ("-inf") = -inf
> val ("+nan") = nan
> val ("-nan") = -nan
> val (1.0123") = 1.01229999999999998
> val (1.01 23") = 1.01000000000000001
> val ("inf") = inf
> =============================================
> Val1 = -1.00000000
> Val2 = 1.00000000
> Val1 < Val2
>
> Val1 = -1.00000000
> Val2 = 0.00000000
> Val1 < Val2
>
> Val1 = -1.00000000
> Val2 = -1.00000000
> Val1 = Val2
>
> Val1 = 0.00000000
> Val2 = 0.00000000
> Val1 = Val2
>
> Val1 = 1.00000000
> Val2 = 1.00000000
> Val1 = Val2
>
> Val1 = -inf
> Val2 = inf
> Val1 < Val2
>
> Val1 = inf
> Val2 = inf
> Val1 = Val2
>
> Val1 = -inf
> Val2 = inf
> Val1 < Val2 <--- Oooh, nice.
>
> Val1 = inf
> Val2 = inf
> Val1 = Val2
>
> Val1 = nan
> Val2 = inf <--- possibly good, possibly bad.
> Val1 = Val2
If anyone's up for writing some SDL, (I'm stuck here for the next 5h)
I need reliable ways to detect +/- inf and +/- nan.
In the #if MyVal = val("inf") sort of way.
^^^
That doesn't need to be the exact implementation, I just need the equivalent
that yields the correct Boolean result.
Square it, multiply it by zero, by -1, test equality to itself, subtract it from
itself, add it to itself, abs(), .... whatever works to
_differentiate inf and nan from the real numbers_.
Thanks!
- BE
Post a reply to this message
|
 |