RE: Uninitialized Variables

new topic     » goto parent     » topic index » view thread      » older message » newer message

-------Phoenix-Boundary-07081998-

Hi Andy Serpa, you wrote on 3/23/02 6:09:54 PM:

<SNIP>

>
>So one way involves two comparisons & a division; the other involves
>converting to a sequence & then up to two comparisions.  Isn't there a
>cheaper way?
>

I tried your code and it failed for me -- the 'y'
case came out "non-NaN"

Have you tried:
    if unknown >= 1e255 then
       puts( 1, "it's a NaN!")
    ....

Works under the interpreter but I haven't tried the compiler
The '1e255' comes directly from the IEEE 754 NaN definition,
so it should be o.k.

The test probably should be:
    if unknown >= 1e255 or unknown <= -1e255 then

Karl Bochert

-------Phoenix-Boundary-07081998---

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu