RE: Uninitialized Variables

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

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

Boy, what a nightmare. 


> 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
> 

Well, Euphoria handles atoms up to 1e300 or so, and after that they end 
up as "inf", which is something else entirely.  So maybe 
atom_to_float32() is the only reliable way, which uses IEEE format...

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

Search



Quick Links

User menu

Not signed in.

Misc Menu