Skip to content

fix(core): improve belonging of point to interval#454

Open
Marthym wants to merge 3 commits intoHipparchus-Math:developfrom
Marthym:hotfix/improve-belonging-of-point-to-interval-lus
Open

fix(core): improve belonging of point to interval#454
Marthym wants to merge 3 commits intoHipparchus-Math:developfrom
Marthym:hotfix/improve-belonging-of-point-to-interval-lus

Conversation

@Marthym
Copy link
Copy Markdown

@Marthym Marthym commented Mar 25, 2026

The test to determine whether a point belongs to the interval [0,1] is not robust to numerical errors. However, it is necessary to allow points that are slightly outside the bounds. Tests have shown that a numerical error of up to 1e-10 can occur in some cases.

ref #460

@Serrof
Copy link
Copy Markdown
Contributor

Serrof commented Apr 28, 2026

Hi there,
thanks for this.
Could you open an issue?
As for the fix, I've got a few remarks:

  • Define a static constant instead of hard coding twice 1e-10
  • It'd be great to add a test that would have failed before

Cheers

@Marthym Marthym force-pushed the hotfix/improve-belonging-of-point-to-interval-lus branch 2 times, most recently from d819a54 to 1f322be Compare April 30, 2026 13:52
The test to determine whether a point belongs to the interval [0,1] is not robust to numerical errors. However, it is necessary to allow points that are slightly outside the bounds. Tests have shown that a numerical error of up to 1e-10 can occur in some cases.

fix Hipparchus-Math#460
@Marthym Marthym force-pushed the hotfix/improve-belonging-of-point-to-interval-lus branch from 1f322be to ca9fe64 Compare April 30, 2026 13:54
@Marthym
Copy link
Copy Markdown
Author

Marthym commented Apr 30, 2026

Thanks for your review

A create the issue #460, add EPSILON constant and add unit test.

Regards

@Serrof
Copy link
Copy Markdown
Contributor

Serrof commented May 3, 2026

Thanks. Please write the comments in the code in English tho, not french

Another thing I forgot: could you please add your fix in the two changes.xml files: the one in Hipparchus-core and the generic one at library level.

Cheers

@Marthym Marthym force-pushed the hotfix/improve-belonging-of-point-to-interval-lus branch from 9ed63dc to e4bfa39 Compare May 4, 2026 10:00
@Marthym
Copy link
Copy Markdown
Author

Marthym commented May 4, 2026

Thanks

  • Comment in english
  • Changes.xml updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants