Question big floating numbers

andrews

Well-known member
Joined
Nov 22, 2011
Messages
132
Programming Experience
5-10
It was not possible to me to get a floating number result using biginteger or using what?

f.e. the division 123456789123456789123456789123456789/987654321
I want some result like 874587964569874568.36521457885476
Is it possible?
 
Division of a BigInteger by another BigInteger can only return a BigInteger. That would presumably be because those numbers can be arbitrarily large so the result may be too big for any other data type. You could perform a division first and then a modulus, then convert the mod result and the divisor to Integer or Long and get a Double result from dividing them.
 
Back
Top