tags:

views:

79

answers:

3

Also is there a place where I could look up all the floating points ops in Scheme?

A: 

Have you read the RnRs document for whatever version of scheme you're using? Other than that you could try looking at your implementations manual for things that aren't in the language spec.

Amuck
+6  A: 

I think this explains it well.

emptyset
So you could do (eqv? a +nan.0). That makes me sad - I was going to suggest (= (* a 2) a) -- much more 'interesting'...
Aaron
@Aaron: Won't that return true for 0?
Amuck
@Amuck - I didn't say it was a _good_ suggestion...
Aaron
+2  A: 

In most programming languages, you can determine NaN values by comparing a value with itself.

(define (nan? x)
  (not (= x x)))
Chris Jester-Young
heh that has interesting semantics.
Claudiu