Implement 'finite?', 'inifinite?' and 'nan?' in Scheme

Issue #59 new
Katie Burke created an issue

finite? should return #t if real is finite, #f otherwise.
infinite? should return #t if real is infinite, #f otherwise.
nan? should return #t if real is a NaN, #f otherwise.
( http://www.scheme.com/tspl4/objects.html#./objects:s97 )

(finite? 2/3)

Traceback (most recent call last):
File "stdin", line 1, col 2
RunTimeError: unbound variable 'finite?'

(infinite? 2/3)

Traceback (most recent call last):
File "stdin", line 1, col 2
RunTimeError: unbound variable 'infinite?'

(nan? 2/3)

Traceback (most recent call last):
File "stdin", line 1, col 2
RunTimeError: unbound variable 'nan?'

Comments (1)

  1. Log in to comment