POV-Ray : Newsgroups : povray.bugreports : 3.8 macro parsing errors : Re: 3.8 macro parsing errors Server Time
24 Mar 2026 14:14:44 EDT (-0400)
  Re: 3.8 macro parsing errors  
From: Bald Eagle
Date: 24 Mar 2026 10:45:00
Message: <web.69c2a29518d864b56750f02625979125@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> 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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.