diff options
author | inoas <mail@inoas.com> | 2022-11-22 13:16:02 +0100 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2022-11-27 11:26:43 +0000 |
commit | 323600561189b7d58066f29c563d4bacb554ec01 (patch) | |
tree | cb505f2aecd4fd8a11611c811a2dc313bcc6b5a5 /src | |
parent | 2f99abda961043edc809ce5570711755a57a2db1 (diff) | |
download | gleam_stdlib-323600561189b7d58066f29c563d4bacb554ec01.tar.gz gleam_stdlib-323600561189b7d58066f29c563d4bacb554ec01.zip |
gleam format
Diffstat (limited to 'src')
-rw-r--r-- | src/gleam/float.gleam | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gleam/float.gleam b/src/gleam/float.gleam index d9ce292..dd6adee 100644 --- a/src/gleam/float.gleam +++ b/src/gleam/float.gleam @@ -289,9 +289,9 @@ if javascript { /// ``` /// pub fn absolute_value(x: Float) -> Float { - case x >=. 0. { + case x >=. 0.0 { True -> x - _ -> 0. -. x + _ -> 0.0 -. x } } @@ -326,14 +326,14 @@ pub fn absolute_value(x: Float) -> Float { /// ``` /// pub fn power(base: Float, of exponent: Float) -> Result(Float, Nil) { - let fractional: Bool = ceiling(exponent) -. exponent >. 0. + let fractional: Bool = ceiling(exponent) -. exponent >. 0.0 // In the following check: // 1. If the base is negative and the exponent is fractional then // return an error as it will otherwise be an imaginary number // 2. If the base is 0 and the exponent is negative then the expression // is equivalent to the exponent divided by 0 and an error should be // returned - case base <. 0. && fractional || base == 0. && exponent <. 0. { + case base <. 0.0 && fractional || base == 0.0 && exponent <. 0.0 { True -> Error(Nil) False -> Ok(do_power(base, exponent)) } @@ -377,7 +377,7 @@ pub fn square_root(x: Float) -> Result(Float, Nil) { /// ``` /// pub fn negate(x: Float) -> Float { - -1. *. x + -1.0 *. x } /// Sums a list of `Float`s. @@ -412,8 +412,8 @@ fn do_sum(numbers: List(Float), initial: Float) -> Float { /// pub fn product(numbers: List(Float)) -> Float { case numbers { - [] -> 0. - _ -> do_product(numbers, 1.) + [] -> 0.0 + _ -> do_product(numbers, 1.0) } } |