Basic HTML version of Foils prepared Feb 19 1999

Foil 12 Real Numbers

From Computing and Java Language Basics NPAC Java Academy February--April 99 -- Feb 13 1999. by Nancy McCracken


Another type of values that you can use in most programming languages is a type for real numbers, i.e. numbers with decimal points. These are sometimes called floating point numbers, and Java has type float. But primarily Java uses a type double for these (so-called because they can be twice as big).
The same arithmetic operators like +, -, * and / are used.
double x, y ;
x = 1.5 ;
y = x / 2.0 ;



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Mon Jul 5 1999