Search⌘ K
AI Features

Fractional values of numbers with `double`

Explore how to work with double in Java to store fractional values. Understand declaring and using double variables through practical coding exercises like calculating circle areas and scaling drawings. Gain skills in handling precise decimal numbers and applying them effectively in Java programs.

We'll cover the following...

The int data type only represents numbers without a fractional part. What if we want to store an approximation for π in a mathematics program? We can use a different data type, called a double, to store numbers that have values after the decimal point. double is short for double-precision floating point. Floating point means that there is a decimal point that can be placed at different locations (or float), in the number.

Computer programming languages evolve over time; double-precision just means that ...