Use doubledouble
for all your calculations and temp variables. Use floatfloat
when you need to maintain an array of numbers - float[] float[]
(if precision is sufficient), and you are dealing with over tens of thousands of floatfloat
numbers.
Many/most math functions or operators convert/return doubledouble
, and you don't want to cast the numbers back to floatfloat
for any intermediate steps.
E.g.
If you have an input of 100,000 numbers from a file or a stream and need to sort them, put the numbers in a float[]float[]
.