Skip to content

Make a whole number the rational search finds an integer - #2071

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
a-whole-number-from-the-rational-search-is-an-integer
Oct 22, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
a-whole-number-from-the-rational-search-is-an-integer

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Fixes #2069.

  • The defect. The continued fraction behind the rational search built its result with new Rational(...). That skips the check in Rational.Create that turns a denominator of 1 into an Integer. So a decimal just below a whole number came back as the Rational 1/1 or 3/1. Such a value is not an Integer, and (Entity)0.9999999999999999999999999999m == 1 was false.
  • The change. The result goes through Rational.Create.

NumericDowncasting.AWholeNumberFromTheRationalSearchIsAnInteger covers 1 and 3; on 2.6.0 they are 1/1 and 3/1.

Results:

  • Unit suite: passes (16,750).
  • Build: the library builds for netstandard2.0.
  • BREAKING-CHANGES: the entry gives the values on 2.6.0 and now.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

The continued fraction built its result with new Rational(...), past the
check in Rational.Create that turns a denominator of one into an Integer,
so a decimal just below a whole number came back as the Rational 1/1 or
3/1: not an Integer, and not equal to 1 or 3.

Fixes #2069.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
@Rafael-SOWNet Rafael-SOWNet added this to the 2.7.0 milestone Oct 22, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit 9c4fb8e into master Oct 22, 2026
37 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in AngouriMath Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

A number read as a whole number can be a Rational with denominator 1

1 participant