New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
is-approx calculates relative tolerance, instead of absolute #5352
Comments
From @zoffixznetThis report is for records only. The fix is already a part of my upcoming rework of `is-approx` code. Problem: both the specification, the documentation, and even the [partially] the old implementation of `is_approx` treat the positional tolerance argument as absolute tolerance, yet `is-approx`'s current algorithm treats it as relative tolerance. |
From @smlsIsn't the relative tolerance more useful though? Maybe it was intentionally changed from absolute to relative as an improvement, and the spec/doc have simply not been updated yet. Maybe searching the IRC logs or git history could illuminate the reasoning behind the current implementation? |
The RT System itself - Status changed from 'new' to 'open' |
From @zoffixznet
Absolute is much easier to understand, use, and predict the lower/upper bounds to. I'd use 1-e15 by default, since that's what ≅ uses, but that's not what was specced/documented. Both tolerance variants are available via named args anyway.
All I see is a commit from a year ago with a link to a Python library's 13-page documentation as justification. Then throughout the year, I see multiple people complaining about the subroutine being broken, so I doubt whatever exquisite behavour that 13-page document describes is in high demand. This morning, I posted in dev my proposal for a rewrite that fixes all the issues and defines/clarifies the extra behaviour currently implemented but unspecced/undocumented. So far, only PerlJam ++ed it. No one else commented. https://github.com/zoffixznet/debug/blob/master/mu/approx-rework.md |
From @zoffixznetProposed PR to fix this: rakudo/rakudo#783 |
From @zoffixznetResolved by this commit: rakudo/rakudo@bb165a5 |
@zoffixznet - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#128303 (status was 'resolved')
Searchable as RT128303$
The text was updated successfully, but these errors were encountered: