save up to 40%

What are floating-point literals?

Are you preparing for IT certification? With practice questions, study notes, interactive quizzes, tips and technical articles, uCertify PrepKits ensure that you get a solid grasp of core technical concepts to ace your certification exam in first attempt.

What are floating-point literals?

Rating:

Floating-point literals are decimal numbers. They can be expressed in either standard or scientific notation.

Standard notation consists of a whole number followed by a decimal point and a fractional component. Examples of floating-point literals expressed in standard notation are 3.145, 2.0, etc.

Scientific notation consists of standard-notation, i.e., a floating-point number, and a suffix that specifies a power of 10 by which the number is to be multiplied. The exponent portion is either represented by an E or e, followed by an integer, which can be either positive or negative. Examples of floating-point literals expressed in scientific notation are 6.02E23, 1e-6, etc.

Floating-point literals are of type double, by default. A floating-point literal, is followed by an F or f, to indicate that the literal is of type float in a program, e.g., 6.023E2F, 23.34f, etc.

Note: Floating-point literals cannot be expressed in hexadecimal and octal notation.


Rating:



Other articles

Click here to Article home

 
uCertify.com | Our Company | Articles | Privacy | Security | Contact Us | News and Press Release | uCertify India
MCSE: MCSA, MCTS, MCITP    JAVA Certification: SCJP, SCWCD Cisco Certification: CCNA, CCENT, A+, Network+, Security+
Oracle Certification: OCP 9i, OCP 10g, OCA 9i, OCA 10g CIW foundation    EC-212-32    CISSP    Photoshop ACE    Adobe Flash ACE
© 2008 uCertify.com. All rights reserved. All trademarks are the property of their respective owners.