Skip to content

Add automatic numeric-to-Complex promotion and simplify mitternacht test and fix test pipeline#4

Merged
TriedAngle merged 1 commit intomasterfrom
codex/run-tests-and-update-cli-executor
Feb 23, 2026
Merged

Add automatic numeric-to-Complex promotion and simplify mitternacht test and fix test pipeline#4
TriedAngle merged 1 commit intomasterfrom
codex/run-tests-and-update-cli-executor

Conversation

@TriedAngle
Copy link
Owner

Motivation

  • Allow mixed numeric/complex arithmetic to work without explicit Complex construction so tests and user code rely on implicit promotion instead of calling Complex directly.
  • Fix the failing mitternacht test by avoiding module name collision and depending on automatic numeric promotion for negative-discriminant quadratic roots.

Description

  • Added asComplex methods to Fixnum, Bignum, Ratio, and Float in core/math.ktt to return Complex clone setRe: self Im: 0 so numeric values can be promoted to Complex automatically.
  • Ensured Complex provides asComplex = { self } so mixed operations call a consistent conversion method.
  • Updated tests/mitternacht.ktt to rename the helper to Quadratic, remove explicit Complex constructions, compute denom and negB as plain numeric expressions, and print both roots for in-file validation.

Testing

  • Ran python run_tests.py, which built the VM and executed the test suite successfully with 17 passed / 0 failed / 0 skipped.
  • The project compiled in release mode and the updated test tests/mitternacht.ktt passed under the new implicit promotion behavior.

Codex Task

@TriedAngle TriedAngle changed the title Add automatic numeric-to-Complex promotion and simplify mitternacht test Add automatic numeric-to-Complex promotion and simplify mitternacht test and fix test pipeline Feb 23, 2026
@TriedAngle TriedAngle merged commit 053e3dd into master Feb 23, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant