Floating point numbers
Floating point numbers follow the IEEE 754 standard and represent numbers with a decimal point such as 3.14 or an exponent notation 4e-14, and come in the types Float16 up to Float64, the last one used for double precision.
Single precision is achieved through the use of the Float32 type. Single precision float literals must be written in scientific notation, such as 3.14f0, but with f ,where one normally uses e. That is, 2.5f2 indicates 2.5*10^2 with single precision, while 2.5e2 indicates 2.5*10^2 in double precision. Julia also has a BigFloat type for arbitrary-precision floating numbers' computations.
A built-in type promotion system takes care of all the numeric types that can work together seamlessly, so that there is ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access