diff --git a/src/gleam/float.gleam b/src/gleam/float.gleam index 34dba054..66e03754 100644 --- a/src/gleam/float.gleam +++ b/src/gleam/float.gleam @@ -1,4 +1,21 @@ //// Functions for working with floats. +//// +//// ## Float representation +//// +//// Floats are represented as 64 bit floating point numbers on both the Erlang +//// and JavaScript runtimes. The floating point behaviour is native to their +//// respective runtimes, so their exact behaviour will be slightly different on +//// the two runtimes. +//// +//// ### Infinity and NaN +//// +//// Under the JavaScript runtime, exceeding the maximum (or minimum) +//// representable value for a floating point value will result in Infinity (or +//// -Infinity). Should you try to divide two infinities you will get NaN as a +//// result. +//// +//// When running on BEAM, exceeding the maximum (or minimum) representable +//// value for a floating point value will raise an error. //// //// ## Division by zero ////