Unexpected Quotients

2/3 = 0

3/2 = 1

1/0 = ArithmeticException

0/0 = ArithmeticException

1.0/0.0 = Inf

1.0/0 = Inf

0.0/0.0 = NaN

-1.0/0.0 = -Inf

Inf + 1 = Inf

Inf + Inf = Inf

Inf - Inf = NaN

Inf/Inf = NaN

NaN + anything = NaN

NaN - anything = NaN

NaN * anything = NaN

NaN / anything = NaN

NaN < NaN is false

NaN > NaN is false

NaN <= NaN is false

NaN >= NaN is false

NaN == NaN is false

NaN != NaN is true


Previous | Next | Top | Cafe au Lait

Copyright 1999, 2002 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified September 12, 2002