Skip to content

Commit 13a6e6d

Browse files
dbrattliclaude
andcommitted
fix: update tests for tupled params, restore CHANGELOG entries
Update tests for comb, copysign, fmod, pow, atan2, dist to use tupled calling convention matching the corrected type signatures. Restore PR #251 entries that were dropped from the Unreleased CHANGELOG section. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4a96a8d commit 13a6e6d

2 files changed

Lines changed: 20 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,16 @@ All notable changes to this project will be documented in this file.
1111

1212
### 🐞 Bug Fixes
1313

14-
* Fix `math.copysign` binding: `y` parameter was incorrectly typed as `int`, now correctly `float``copysign(x, y)` always takes two floats
15-
* Fix `math.fmod` binding: parameters were incorrectly typed as `int * int -> int`, now correctly `float * float -> float``fmod` computes floating-point remainder
16-
* Fix `math.comb`, `math.pow`, `math.atan2`, `math.dist` bindings: converted curried parameter syntax to tupled for consistency with all other multi-parameter bindings in the codebase
14+
* Fix `math.factorial` binding: changed signature from `float -> float` to `int -> int` to match Python 3.12+ where float arguments raise `TypeError`. Fixes test to use integer literals.
15+
* Fix `math.copysign` binding: `y` parameter was incorrectly typed as `int`, now correctly `float`
16+
* Fix `math.fmod` binding: parameters were incorrectly typed as `int -> int -> int`, now correctly `float * float -> float`
17+
* Fix `math.comb`, `math.pow`, `math.atan2`, `math.dist` bindings: converted curried parameter syntax to tupled for consistency
18+
19+
### ✨ Enhancements
20+
21+
* Add missing `math` module constants: `pi`, `e`, `tau`, `inf`, `nan`
22+
* Add missing `math` module functions: `sqrt`, `degrees`, `radians`, `trunc`, `hypot`, `fsum`, `isqrt`, `prod`, `perm`, `acosh`, `asinh`, `atanh`, `cosh`, `sinh`, `tanh`, `erf`, `erfc`, `gamma`, `lgamma`
23+
* Fix `math.dist` signature to accept float arrays (for multi-dimensional distance)
1724

1825
## 5.0.0-rc.3 - 2026-04-16
1926

test/TestMath.fs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ let ``test floor works`` () =
1717

1818
[<Fact>]
1919
let ``test comb works`` () =
20-
math.comb 5 2 |> equal 10
21-
math.comb 10 3 |> equal 120
20+
math.comb (5, 2) |> equal 10
21+
math.comb (10, 3) |> equal 120
2222

2323
[<Fact>]
2424
let ``test copysign works`` () =
25-
math.copysign 1.0 -1 |> equal -1.0
26-
math.copysign -1.0 1 |> equal 1.0
25+
math.copysign (1.0, -1.0) |> equal -1.0
26+
math.copysign (-1.0, 1.0) |> equal 1.0
2727

2828
[<Fact>]
2929
let ``test fabs works`` () =
@@ -37,8 +37,8 @@ let ``test factorial works`` () =
3737

3838
[<Fact>]
3939
let ``test fmod works`` () =
40-
math.fmod 10 3 |> equal 1
41-
math.fmod 7 2 |> equal 1
40+
math.fmod (10.0, 3.0) |> equal 1.0
41+
math.fmod (7.0, 2.0) |> equal 1.0
4242

4343
[<Fact>]
4444
let ``test gcd works`` () =
@@ -89,8 +89,8 @@ let ``test log10 works`` () =
8989

9090
[<Fact>]
9191
let ``test pow works`` () =
92-
math.pow 2.0 3.0 |> equal 8.0
93-
math.pow 10.0 2.0 |> equal 100.0
92+
math.pow (2.0, 3.0) |> equal 8.0
93+
math.pow (10.0, 2.0) |> equal 100.0
9494

9595
[<Fact>]
9696
let ``test sin works`` () =
@@ -118,7 +118,7 @@ let ``test atan works`` () =
118118

119119
[<Fact>]
120120
let ``test atan2 works`` () =
121-
math.atan2 0.0 1.0 |> equal 0.0
121+
math.atan2 (0.0, 1.0) |> equal 0.0
122122

123123
[<Fact>]
124124
let ``test pi constant works`` () =
@@ -182,7 +182,7 @@ let ``test perm works`` () =
182182

183183
[<Fact>]
184184
let ``test dist works`` () =
185-
math.dist [| 0.0; 0.0 |] [| 3.0; 4.0 |] |> equal 5.0
185+
math.dist ([| 0.0; 0.0 |], [| 3.0; 4.0 |]) |> equal 5.0
186186

187187
[<Fact>]
188188
let ``test cosh works`` () =

0 commit comments

Comments
 (0)