-Infinity / -Infinity

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

Okay...

I wrote a quick test program to play with infinities and not-a-numbers =
for a few minutes. My code is:

   atom A

   A =3D 1e300

   print (1, A)
   puts (1, ' ')

   A =3D 1e300 * 1e300 -- this makes A =3D infinity

   print (1, A)
   puts (1, ' ')

   A =3D 0 - A

   print (1, A)
   puts (1, ' ')

   A =3D A / A

   print (1, A)
   puts (1, ' ')

   A =3D 0 - A

   print (1, A)
   puts (1, ' ')

At "A =3D 0 - A", we have a negative infinity. I understand that. Then =
"A / A" (i.e., -inf / -inf) is computed, resulting in a negative nan. =
Um... is this *supposed* to be the case with infinities? I would have =
thought that two negatives, even infinities, would result in a positive =
number (or not-a-number). Or is my higher math education incomplete?

(In case it matters, this is version 2.0 of Euphoria... has this been =
addressed in the upgrade, assuming it's actually a problem?)


Rod Jackson

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

Search



Quick Links

User menu

Not signed in.

Misc Menu