ocaml: phase 6 Float module fleshed out (+6 tests, 598 total)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 23s

New Float members:
  zero / one / minus_one
  abs / neg
  add / sub / mul / div     (lift host '+.' '-.' '*.' '/.')
  max / min                 (if-based)
  equal / compare           (Float.compare returns -1 / 0 / 1)
  to_int                    (host floor)
  of_int                    (identity in dynamic runtime)
  of_string                 (delegates to _int_of_string)

Aligns Float with Int's API and lets baselines use Float.add /
Float.compare / etc without lifting the symbols themselves.

  Float.add 3.5 4.5         = 8
  Float.compare 2.5 5.0     = -1
  Float.abs -3.7            = 3.7
  Float.max 3.14 2.71       = 3.14
This commit is contained in:
2026-05-09 07:09:29 +00:00
parent 97a8c06690
commit e42ff3b1f6
3 changed files with 45 additions and 0 deletions

View File

@@ -407,6 +407,12 @@ _Newest first._
binary search tree (`type 'a tree = Leaf | Node of 'a * 'a tree *
'a tree`) with insert + in-order traversal. Tests parametric ADT,
recursive match, List.append, List.fold_left.
- 2026-05-09 Phase 6 — Float module fleshed out (+6 tests, 598
total). New Float members: zero, one, minus_one, abs, neg, add,
sub, mul, div, max, min, equal, compare, to_int, of_int,
of_string. Most just lift the host operators (`+.` is already
available as a global). Aligns Float with Int module's API and
unblocks idiomatic float arithmetic in baselines.
- 2026-05-09 Phase 5.1 — balance.ml baseline (paren/bracket/brace
balance using Stack). is_balanced walks a string; on opener push,
on closer check stack non-empty + top matches expected opener (else