programming forums Java Java JSRs Mobile Certification Databases Caching Books Engineering OS Languages Paradigms IDEs Build Tools Frameworks Products This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Sheriffs:
Saloon Keepers:
Bartenders:

# E-4 double value

kri shan
Ranch Hand
Posts: 1489
13.61234567891234  Vs 13.61234567891234E-4 double value

double d = 13.61234567891234;   d is greater than 10

double d = 13.61234567891234E-4;  d is less than 10

Stephan van Hulst
Saloon Keeper
Posts: 7976
143
Yes, that's correct. Do you have a question?

kri shan
Ranch Hand
Posts: 1489
Why 13.61234567891234E-4  d is less than 10 ?    How to remove E-4 from the double value ?

Henry Wong
author
Sheriff
Posts: 23295
125
kri shan wrote:Why 13.61234567891234E-4  d is less than 10 ?    How to remove E-4 from the double value ?

Do you know how scientific notation works?

Henry

kri shan
Ranch Hand
Posts: 1489
How to convert to 13.61234567891234 from 13.61234567891234E-4 ?

Stephan van Hulst
Saloon Keeper
Posts: 7976
143
That's kind of like asking how to convert from 1 to 2. They are different values.

Why do you want to do this?

Henry Wong
author
Sheriff
Posts: 23295
125
kri shan wrote:How to convert to 13.61234567891234 from 13.61234567891234E-4 ?

To get 13.61234567891234 from 13.61234567891234E-4, you would have to multiply by 10000. And technically, it is not "converting" as those are two different numbers.

Henry

Carey Brown
Saloon Keeper
Posts: 3315
46
13.61234567891234E-4
essentially means, take the value
13.61234567891234
and move the decimal point 4 spaces to the left, yielding
0.001361234567891234