Java Program To Multiply Two Floating Point Numbers
Chapter:
Java Basics
Last Updated:
25-08-2017 08:12:59 UTC
Program:
/* ............... START ............... */
public class JavaMultiplyFloatingPointNumbers {
public static void main(String[] args) {
float value1 = 4.5f;
float value2 = 5.0f;
float result = value1 * value2;
System.out.println("Result: " + result);
}
}
/* ............... END ............... */
Output
Notes:
-
The JVM's floating-point support adheres to the IEEE-754 1985 floating-point standard. This standard defines the format of 32-bit and 64-bit floating-point numbers and defines the operations upon those numbers. In the JVM, floating-point arithmetic is performed on 32-bit floats and 64-bit doubles.
Tags
Multiply Two Floating Point Numbers, Java, Basics