Skip to content

Commit cd074ab

Browse files
committed
Improve documentation
As suggested by @NNBnh, thank you!! #867 (comment)
1 parent 845afd5 commit cd074ab

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/gleam/float.gleam

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,12 @@ pub fn parse(string: String) -> Result(Float, Nil)
6363
@external(javascript, "../gleam_stdlib.mjs", "float_to_string")
6464
pub fn to_string(x: Float) -> String
6565

66-
/// Restricts a `Float` between two bounds.
66+
/// Restricts a float between two bounds.
67+
///
68+
/// Note: If the `min` argument is larger than the `max` argument then they
69+
/// will be swapped, so the minimum bound is always lower than the maximum
70+
/// bound.
71+
///
6772
///
6873
/// ## Examples
6974
///

src/gleam/int.gleam

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@ pub fn to_float(x: Int) -> Float
281281

282282
/// Restricts an int between two bounds.
283283
///
284+
/// Note: If the `min` argument is larger than the `max` argument then they
285+
/// will be swapped, so the minimum bound is always lower than the maximum
286+
/// bound.
287+
///
284288
/// ## Examples
285289
///
286290
/// ```gleam

0 commit comments

Comments
 (0)