Skip to content

Commit ced490f

Browse files
mooreryanlpil
authored andcommitted
Add float representation info to module docs
Addresses #783.
1 parent 619935a commit ced490f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/gleam/float.gleam

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
11
//// Functions for working with floats.
2+
////
3+
//// ## Float representation
4+
////
5+
//// Floats are represented as 64 bit floating point numbers on both the Erlang
6+
//// and JavaScript runtimes. The floating point behaviour is native to their
7+
//// respective runtimes, so their exact behaviour will be slightly different on
8+
//// the two runtimes.
9+
////
10+
//// ### Infinity and NaN
11+
////
12+
//// Under the JavaScript runtime, exceeding the maximum (or minimum)
13+
//// representable value for a floating point value will result in Infinity (or
14+
//// -Infinity). Should you try to divide two infinities you will get NaN as a
15+
//// result.
16+
////
17+
//// When running on BEAM, exceeding the maximum (or minimum) representable
18+
//// value for a floating point value will raise an error.
219
////
320
//// ## Division by zero
421
////

0 commit comments

Comments
 (0)