Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
• Campbell Ritchie
• Jeanne Boyarsky
• Ron McLeod
• Paul Clapham
• Liutauras Vilda
Sheriffs:
• paul wheaton
• Rob Spoor
• Devaka Cooray
Saloon Keepers:
• Stephan van Hulst
• Tim Holloway
• Carey Brown
• Frits Walraven
• Tim Moores
Bartenders:
• Mikalai Zaikin

# primitive float help

Ranch Hand
Posts: 95
• Number of slices to send:
Optional 'thank-you' note:
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

Ranch Hand
Posts: 377
• Number of slices to send:
Optional 'thank-you' note:

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
• Number of slices to send:
Optional 'thank-you' note:
Thanks Manfred

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

Ranch Hand
Posts: 621
• Number of slices to send:
Optional 'thank-you' note:
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.............

Ranch Hand
Posts: 99
• Number of slices to send:
Optional 'thank-you' note:
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

Java Cowboy
Posts: 16084
88
• Number of slices to send:
Optional 'thank-you' note:

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