● All four behaviors are correct: #22

Merged
navicore merged 1 commit from issue-17 into main 2026-06-02 17:54:47 +00:00
Owner

#17

  • 10 / 3 = 3.3333333333333335 (was 3)
  • -10 / 3 = -3.3333333333333335 (was -3)
  • float(X) succeeds after /
  • 10 // 3 = 3 (unchanged — integer truncation preserved)
  • 1 / 0 throws evaluation_error(zero_divisor) with the corrected "float division" label

Summary: arith_div Int/Int arm now routes through check_float(*a as f64 / *b as f64) per ISO 13211-1 §9.1.4.
Zero-divisor labels collapsed to "float division" since all paths now produce float results. Five regression
tests added in tests/integration.rs covering positive/negative quotients, exact-quotient float-ness (verified
via float/1), unaffected // behavior, and the int-by-zero error. All 343 tests green.

Note for the loglings curriculum: 10 / 3 printing as 3.3333333333333335 (15-digit string of 3s plus a 5) is the
standard IEEE 754 double-precision round-trip representation. If you want curriculum-friendlier output (e.g.
3.3333333333333 or ~3.333), that's a separate printer concern worth its own discussion.

https://git.navicore.tech/navicore/patch-prolog/issues/17 - 10 / 3 = 3.3333333333333335 (was 3) - -10 / 3 = -3.3333333333333335 (was -3) - float(X) succeeds after / - 10 // 3 = 3 (unchanged — integer truncation preserved) - 1 / 0 throws evaluation_error(zero_divisor) with the corrected "float division" label Summary: arith_div Int/Int arm now routes through check_float(*a as f64 / *b as f64) per ISO 13211-1 §9.1.4. Zero-divisor labels collapsed to "float division" since all paths now produce float results. Five regression tests added in tests/integration.rs covering positive/negative quotients, exact-quotient float-ness (verified via float/1), unaffected // behavior, and the int-by-zero error. All 343 tests green. Note for the loglings curriculum: 10 / 3 printing as 3.3333333333333335 (15-digit string of 3s plus a 5) is the standard IEEE 754 double-precision round-trip representation. If you want curriculum-friendlier output (e.g. 3.3333333333333 or ~3.333), that's a separate printer concern worth its own discussion.
● All four behaviors are correct:
All checks were successful
CI - Linux / CI - Linux x86_64 (pull_request) Successful in 21s
af7f3db114
- 10 / 3 = 3.3333333333333335 (was 3)
  - -10 / 3 = -3.3333333333333335 (was -3)
  - float(X) succeeds after /
  - 10 // 3 = 3 (unchanged — integer truncation preserved)
  - 1 / 0 throws evaluation_error(zero_divisor) with the corrected "float division" label

  Summary: arith_div Int/Int arm now routes through check_float(*a as f64 / *b as f64) per ISO 13211-1 §9.1.4.
  Zero-divisor labels collapsed to "float division" since all paths now produce float results. Five regression
  tests added in tests/integration.rs covering positive/negative quotients, exact-quotient float-ness (verified
  via float/1), unaffected // behavior, and the int-by-zero error. All 343 tests green.

  Note for the loglings curriculum: 10 / 3 printing as 3.3333333333333335 (15-digit string of 3s plus a 5) is the
  standard IEEE 754 double-precision round-trip representation. If you want curriculum-friendlier output (e.g.
  3.3333333333333 or ~3.333), that's a separate printer concern worth its own discussion.
navicore deleted branch issue-17 2026-06-02 17:54:47 +00:00
Sign in to join this conversation.
No description provided.