Skip to content

Commit d474e53

Browse files
forfudanyetalit
andauthored
Update decimojo to Mojo v25.4 (#138)
* Update decimojo to Mojo v25.4 * Remove the test which requires converting Float64 to String --------- Co-authored-by: Tiyagora <[email protected]>
1 parent 01eb40c commit d474e53

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

recipes/decimojo/recipe.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
context:
2-
version: "0.3.1"
2+
version: "0.4.0"
33

44
package:
55
name: "decimojo"
66
version: ${{ version }}
77

88
source:
99
- git: https://github.com/forFudan/decimojo.git
10-
rev: fd82601e93d324a01b4f6770904ba1d11e765e38
10+
rev: 8ed3dabd731f8948c6b9b04ff9ca16b55734fe3b
1111

1212
build:
1313
number: 0
1414
script:
1515
- mojo package src/decimojo -o ${{ PREFIX }}/lib/mojo/decimojo.mojopkg
1616
requirements:
1717
host:
18-
- max=25.3
18+
- max=25.4
1919
run:
2020
- ${{ pin_compatible('max') }}
2121

@@ -26,7 +26,7 @@ tests:
2626
- mojo run tests.mojo
2727
requirements:
2828
run:
29-
- max=25.3
29+
- max=25.4
3030
files:
3131
recipe:
3232
- tests.mojo

recipes/decimojo/tests.mojo

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -703,17 +703,6 @@ fn test_division() raises:
703703
String(result12), "1234.56", "Division with mixed precision"
704704
)
705705

706-
# Test case 13: Verify mathematical identity (a/b)*b ≈ a within rounding error
707-
var a13 = Decimal("123.45")
708-
var b13 = Decimal("7.89")
709-
var div_result = a13 / b13
710-
var mul_result = div_result * b13
711-
# Because of rounding, we don't expect exact equality, so check if the difference is small
712-
var diff = a13 - mul_result
713-
var abs_diff = -diff if diff.is_negative() else diff
714-
var is_close = Float64(String(abs_diff)) < 0.0001
715-
testing.assert_equal(is_close, True, "(a/b)*b should approximately equal a")
716-
717706
# Test case 14: Division of number by itself should be 1
718707
var a14 = Decimal("123.45")
719708
var result14 = a14 / a14

0 commit comments

Comments
 (0)