Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Floating point: Difference between revisions

From Coderwiki
new
 
(No difference)

Latest revision as of 12:37, 9 August 2025

Floating point numbers are a data type that is able to store decimal numbers as opposed to just an integer.

Like with integers, you can usually apply arithmetic operators to floating-point numbers (add, subtract, multiply and divide) but some operators may not work with floats.

Examples of floating-point values

edit edit source
5.1
4.0
-27.3
6.4e7
1.2e-27

Non-examples of floating-point values

edit edit source
5 (unless casted)
"4.3"
false
'7'