Skip to content

Commit

Permalink
Add float representation info to module docs
Browse files Browse the repository at this point in the history
Addresses gleam-lang#783.
  • Loading branch information
mooreryan committed Dec 31, 2024
1 parent f9aea4a commit 4dd9dad
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/gleam/float.gleam
Original file line number Diff line number Diff line change
@@ -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
////
Expand Down

0 comments on commit 4dd9dad

Please sign in to comment.