From: Tobias Peters Date: 2003-02-04T21:33:10+09:00 Subject: Re: Native rational and complex number implementations? On Tue, 4 Feb 2003, Gavin Sinclair wrote: > I believe it would be beneficial to have Rational and Complex > as built-in classes. Could you tell some concrete expectations from making them built-in, i.e. the reasons why you think it would be beneficial? All that I would like to have built in is a ruby literal for specifying complex numbers (a literal for purely imaginary numbers would be sufficient, of course) because it's tedious to write Complex(2,3) if what you want is 2+3i (Btw, it would be nice if ruby's parser were dynamically extensible to allow adding features like this) I know I could define a constant I and write 2+3*I but it's uglier. Also, Complex.to_s would then produce output valid for ruby's parser to read. I don't think significant performance gains are possible by making Complex built-in because of the templated nature of the Complex class (real and imaginary part can be any Numeric except Complex itself). T