javolution / jscience

Tools & Libraries for the Advancement of Sciences (v5.0 - early 2018)
http://jscience.org
Other
85 stars 23 forks source link

Why Complex class use double type to save real component and imaginary component? #1

Open liudaomanbu opened 6 years ago

liudaomanbu commented 6 years ago

Are you sure there will be no accuracy problem?

agdturner commented 3 years ago

There probably should be implementations for different types of number. I don't know about any usage scenarios for the class based on double, but if double is not precise enough, then maybe a rational, a root or an algebraic number would suffice. If not, then a real number is needed. The more numbers allowed the more accuracy you might generally get, but more computation and data storage will generally be wanted. Often a precision/resolution will need to be computed once all the terms are simplified...