tests for floating point mod (#9636)

This commit is contained in:
GregoryTravis 2024-04-05 09:52:55 -04:00 committed by GitHub
parent 9cf4847a34
commit 6e1295379a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -315,7 +315,7 @@ add_specs suite_builder =
group_builder.specify "should define multiplication" <|
2*3 . should_equal 6
group_builder.specify "should define modulo for integers and decimals" <|
group_builder.specify "should define modulo for integers and floats" <|
5%3 . should_equal 2
5%3 . should_be_a Integer
@ -329,6 +329,8 @@ add_specs suite_builder =
3.5%2 . should_equal 1.5
10.5%1.0 . should_equal 0.5
11.5%1.5 . should_equal 1.0
3%1 . should_equal 0
3%1 . should_be_a Integer
@ -354,7 +356,7 @@ add_specs suite_builder =
(9223372036854775809 % 10) . should_equal 9
(7000000000000000000007 % 10) . should_equal 7
group_builder.specify "should define modulo for negative integers and decimals" <|
group_builder.specify "should define modulo for negative integers and floats" <|
-5%3 . should_equal -2
-5%3 . should_be_a Integer
@ -368,6 +370,8 @@ add_specs suite_builder =
-3.5%2 . should_equal -1.5
-10.5%1.0 . should_equal -0.5
-11.5%1.5 . should_equal -1.0
-3%1 . should_equal 0
-3%1 . should_be_a Integer