Re: Checking for Undefined [was Re: Ada vs Fortran for scientific applications]



Hi,

I think you might have missed the point of the NaN discussion. It wasn't
about the language being able to represent it, but by using such a bit
pattern to detect an access to a memory location that had never been set by
the program.

Ed

Nasser Abbasi wrote:

"Bob Lidral" <l1dralspamba1t@xxxxxxxxxxx> wrote in message
news:4475DA0F.5030603@xxxxxxxxxxxxxx
Gordon Sande wrote:


That's one of the features I miss about the old CDC CYBER architectures.
Their (one's complement, sigh) numeric format supported plus or minus
infinity (e.g., divide a non-zero number by zero) and plus or minus
indefinite (e.g., divide zero by zero, infinity by infinity, or use an
"indefinite" value anywhere in a divide operation).

hi,

fyi, Matlab supports NAN's, and it has Inf and -Inf (infinities)

a=1/0;
Warning: Divide by zero.
a
a =
Inf

a-Inf
ans =
NaN

1-Inf
ans =
-Inf

Mathematica also:

In[12]:= 1./0;
(warning displayed like in Matlab)

Out[13]= ComplexInfinity


Nasser

.



Relevant Pages

  • Re: zero and infinity
    ... > Infinity is not a number. ... > You cannot divide by something that is not a number. ... Where on earth did you get the strange idea that zero is some sort ... Zero / zero can only equal zero, ...
    (sci.physics.relativity)
  • Re: Im always a winner
    ... Divide by zero in any equation and you get ... so you can't just check it against a NaN you happen to have ... True, but then infinity isn't a number either, ...
    (alt.usage.english)
  • Re: zero and infinity
    ... >X divided by zero approaches infinity; ... to divide some number x by some number y is to iteratively subtract y ... this is correct answer is 1 with a remainder of 0 ...
    (sci.physics.relativity)
  • Re: zero and infinity
    ... | X divided by zero approaches infinity; ... fails when you divide by zero, even though it looks as if you've ...
    (sci.physics.relativity)
  • Re: infinity
    ... >> If you ask most people what infinity times zero is, ... which is a sparse set in the reals. ... mapped by any finite formula from the naturals. ...
    (sci.math)

Loading