• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

primitive float help

 
Praveen Seluka
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Manfred

And is .11 the resultant value of 1.1e-1?
 
dhwani mathur
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Eclipse IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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: 15441
41
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic