aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes primitive float help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "primitive float help" Watch "primitive float help" New topic
Author

primitive float help

Praveen Seluka
Ranch Hand

Joined: Jul 17, 2007
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

Joined: Jun 04, 2007
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

Joined: Jul 17, 2007
Posts: 95
Thanks Manfred

And is .11 the resultant value of 1.1e-1?
dhwani mathur
Ranch Hand

Joined: May 08, 2007
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

Joined: Mar 19, 2007
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


MooN
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14269
    
  21

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


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: primitive float help