aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoryoshi~ <jreusch4@gmail.com>2025-01-02 17:21:20 +0100
committerLouis Pilfold <louis@lpil.uk>2025-01-03 20:44:56 +0000
commit619935a6e79dce3262712838c4cb1c1b69f33132 (patch)
treebab9c83c3dea2c09f7f0fff5bb6c314240438390 /test
parentf9aea4a694fff1bd54cc43c807635a579cf8af8d (diff)
downloadgleam_stdlib-619935a6e79dce3262712838c4cb1c1b69f33132.tar.gz
gleam_stdlib-619935a6e79dce3262712838c4cb1c1b69f33132.zip
improve precision
Diffstat (limited to 'test')
-rw-r--r--test/gleam/float_test.gleam6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/gleam/float_test.gleam b/test/gleam/float_test.gleam
index 1c8f96b..6503a6b 100644
--- a/test/gleam/float_test.gleam
+++ b/test/gleam/float_test.gleam
@@ -288,6 +288,12 @@ pub fn to_precision_test() {
float.to_precision(435.3224, -0)
|> should.equal(435.0)
+
+ float.to_precision(184.20000000000002, 2)
+ |> should.equal(184.2)
+
+ float.to_precision(12_345_678_912_345_678_912_345_678.0, -19)
+ |> should.equal(1_234_568.0e19)
}
pub fn min_test() {