wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes floating point literals Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "floating point literals" Watch "floating point literals" New topic
Author

floating point literals

Mansi Vyas
Greenhorn

Joined: Jul 01, 2003
Posts: 27
Do we need to be familiar with exponent notation for the exam?
e.g. float f = 43e1;
dennis zined
Ranch Hand

Joined: Mar 07, 2003
Posts: 330
Yes, I would think so. Its not that difficult though.
Your example, by the way, should be:
e.g. float f = 43e1f;
floating-point numbers are double by default, so you need to indicate its float to assign it to a float variable.


SCJP 1.4<br />SCWCD 1.4
Derek Baker
Ranch Hand

Joined: May 23, 2003
Posts: 46
I should probably know this, but what does 43e1 represent? 43^1? 43*10^1? Something like that, I think.
dennis zined
Ranch Hand

Joined: Mar 07, 2003
Posts: 330
Actually its 43 * 10 expressed in floating-point type numeral. '^' is the bitwise/logical exclusive OR.
Derek Baker
Ranch Hand

Joined: May 23, 2003
Posts: 46
Sorry, shouldn't have used that symbol. So that's 43 * (10 to the first power)?
 
 
subject: floating point literals