Re: Uninitialized Variables

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

Chris, now I'm totally confused. Sorry.

Are you saying that you get the same results as Andy and get different
results to me?

And you and I are using the same CPU type, and Andy is using a different
CPU.

If this is so, what explains the difference in the results then?

Just so we are on an even footing again, here is the code I'm testing:
-----------
atom x,y,nan,inf
constant true=1, false = 0
inf = 1e300 * 1e300
nan = -(inf / inf)

x = nan
y = 10
if x = nan then
    puts(1, "x is not a number - expected this.\n")
else
    puts(1, "x is a number - did not expect this\n")
end if
if y = nan then
    puts(1, "y is not a number - did not expect this\n")
else
    puts(1, "y is a number - expected this\n")
end if

printf(1, "%d expected %d\n", {x = nan,   true} )
printf(1, "%d expected %d\n", {x != nan,  false})
printf(1, "%d expected %d\n", {y = nan,   false})
printf(1, "%d expected %d\n", {y != nan,  true})
printf(1, "%d expected %d\n", {10 = nan,  false})
printf(1, "%d expected %d\n", {10 != nan, true})
printf(1, "%d expected %d\n", {x = nan,   true})
printf(1, "%d expected %d\n", {x = inf,   false})
printf(1, "%d expected %d\n", {x = 10,    false})
printf(1, "%d expected %d\n", {x + 5,     nan})
printf(1, "%d expected %d\n", {nan,       nan})
printf(1, "%d expected %d\n", {inf,       inf})
printf(1, "%d expected %d\n", {equal(10,nan), false})
printf(1, "%d expected %d\n", {not equal(10,nan), true})
printf(1, "%d expected %d\n", {equal(nan,nan), true})
printf(1, "%d expected %d\n", {10 = nan,  false})
printf(1, "%d expected %d\n", {not (10 = nan), true})
printf(1, "%d expected %d\n", {nan = nan, true})
------------
In all these case, I got exactly what I expected.

Hopes this helps.
Derek.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu