Implement 'real-part' and 'imag-part' in scheme

Issue #92 new
Katie Burke created an issue

real-part should return the real component of num. imag-part should return the imaginary component of num. ( http://www.scheme.com/tspl4/objects.html#./objects:s120 )

This should return 3.

(real-part 3+4i)

Traceback (most recent call last):
File "stdin", line 1, col 12
RunTimeError: unbound variable '3+4i'

This should return 4.

(imag-part 3+4i)

Traceback (most recent call last):
File "stdin", line 1, col 12
RunTimeError: unbound variable '3+4i'

Comments (1)

  1. Log in to comment