Merge branch 'main' into auto-snake-case

This commit is contained in:
Sam Mohr 2025-01-05 16:50:24 -08:00
commit cd0e2a4474
No known key found for this signature in database
GPG key ID: EA41D161A3C1BC99
24 changed files with 95 additions and 51 deletions

View file

@ -874,7 +874,7 @@ map_with_index_help = \src, dest, func, index, length ->
## All of these options are compatible with the others. For example, you can use `At` or `After`
## with `start` regardless of what `end` and `step` are set to.
range : _
range = \{ start, end, step ? 0 } ->
range = \{ start, end, step ?? 0 } ->
{ calc_next, step_is_positive } =
if step == 0 then
when T(start, end) is

View file

@ -617,8 +617,8 @@ is_gte : Num a, Num a -> Bool
##
## If either argument is [*NaN*](Num.is_nan), returns `Bool.false` no matter what. (*NaN*
## is [defined to be unordered](https://en.wikipedia.org/wiki/NaN#Comparison_with_NaN).)
is_approx_eq : Frac a, Frac a, { rtol ? Frac a, atol ? Frac a } -> Bool
is_approx_eq = \x, y, { rtol ? 0.00001, atol ? 0.00000001 } ->
is_approx_eq : Frac a, Frac a, { rtol ?? Frac a, atol ?? Frac a } -> Bool
is_approx_eq = \x, y, { rtol ?? 0.00001, atol ?? 0.00000001 } ->
eq = x <= y && x >= y
meets_tolerance = Num.abs_diff(x, y) <= Num.max(atol, (rtol * Num.max(Num.abs(x), Num.abs(y))))
eq || meets_tolerance