Return complex results when log is passed a negative number
justinethier opened this issue · 0 comments
justinethier commented
log
is not defined on negative real numbers; if a negative value z
is passed the result should be computed as though log
received the complex number z+0i
.
Consider:
cyclone> (log -1)
-nan.0
cyclone> (log -1+0i)
3.14159265358979i
See also: https://docs.scheme.org/surveys/complex-logarithm/