- marked as enhancement
Implement inexact, exact, exact->inexact and inexact->exact in scheme
inexact should return an inexact representation of num
exact should return an exact representation of num
exact->inexact should return an inexact representation of num
inexact->exact should return an exact representation of num
( http://www.scheme.com/tspl4/objects.html#./objects:s112 )
This example should return 3.0
(inexact 3)
Traceback (most recent call last):
File "stdin", line 1, col 2
RunTimeError: unbound variable 'inexact'
This example should return 3
(exact 3.0)
Traceback (most recent call last):
File "stdin", line 1, col 2
RunTimeError: unbound variable 'exact'
This example should return 3.0
(exact->inexact 3.0)
Traceback (most recent call last):
File "stdin", line 1, col 2
RunTimeError: unbound variable 'exact->inexact'
This example should return 3
(inexact->exact 3.0)
Traceback (most recent call last):
File "stdin", line 1, col 2
RunTimeError: unbound variable 'inexact->exact'
Comments (1)
-
- Log in to comment