jl66
asked on
how print out all digits after decimal point for a variable (data type double) in java?
Would like to print out max digits for a variable (data type double). For example,
double d1 = 100.0123456789012345678901 2345678901 2345678901 23456789
double d2 = 2.0
How to print out d1/d2, which still keeps exact answer?
Another one:
d1 = 1.0; d2 = 3.0
How to print out the digits of d1/d2 as many as possible for this data type?
double d1 = 100.0123456789012345678901
double d2 = 2.0
How to print out d1/d2, which still keeps exact answer?
Another one:
d1 = 1.0; d2 = 3.0
How to print out the digits of d1/d2 as many as possible for this data type?
Not sure your question makes much sense - to me at any rate.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the tip.
If BigDecimal is not used, there is anything we can do with "double" to test the digit limit for "double" after the decimal point? The reason is that many math functions only deal with "double", but not BigDecimal. We want to keep the precision as high as possible.
If BigDecimal is not used, there is anything we can do with "double" to test the digit limit for "double" after the decimal point? The reason is that many math functions only deal with "double", but not BigDecimal. We want to keep the precision as high as possible.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks a lot.