# primitive float help

Praveen Seluka
Ranch Hand
Posts: 95
Hi all

double f=1.1e-1d;

I cannot understand the e and d there.Think e is exponential ,what is d?

Thanks
Praveen SP

Manfred Klug
Ranch Hand
Posts: 377
Originally posted by Praveen Seluka:
Think e is exponential
Correct.
what is d?
D or d specifies that this literal is a double value. In contrast, use f or F for float values.

Praveen Seluka
Ranch Hand
Posts: 95
Thanks Manfred

And is .11 the resultant value of 1.1e-1?

dhwani mathur
Ranch Hand
Posts: 621
Hi Manfred!!

But as per i know it is optional to use D or d
for a double isnt it?then why it is mentioned here?
And in case of float it is compulsory for us to use
F or f.............

Abdullah Mamun
Ranch Hand
Posts: 99
Hi Dhwani

Originally posted by dhwani mathur :
But as per i know it is optional to use D or d
for a double isnt it?

This is correct. Since it is optional there is no problem using it too right

Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15216
36
Originally posted by Praveen Seluka:
Thanks Manfred

And is .11 the resultant value of 1.1e-1?

1.1e-1 means: 1.1 times 10 to the power of -1 = 1.1 * 0.1 = 0.11