KenD> > Currently:
-1 asComplex isNumber --> true ?1 asComplex isNumber -> true -1 asComplex < 1 asComplex --> error
-4 sqrt --> error
Igor Stasenko <siguctua@gmail.com>>
and it should. Not many people using a complex numbers. And -4 is an integer number, not complex number (i hope this non-objectionable?). And sqrt function is not defined for real/integer numbers < 0 ,and should lead to error, period. If you change this behavior, some of code will fail to work correctly , definitely. But you are free to use something like: -4 asComplex sqrt
So you prefer (1 asFraction / 2) -> 1/2 , where (1/2) gives an error because 1 and 2 are not fractions? (-1 sqrt) is the definition of 1i . Other dynamic languages I use [Scheme, Lisp] which define complex numbers all give square roots of negative numbers. I am trying to approach the Principle of Least Surprise here. Computers are very bad at math, but we have learned painfully to work around this. I would like pre-computer high school math to "just work". IEEE Floats only guarantee the wrong answer fast, IMHO. I would like square roots of negative numbers to work like they did before I got a computer! 8^) 8^O 8^{ Cheers, -KenD