Implement major math functions - #336
Merged
Merged
Conversation
tompng
force-pushed
the
implement_major_math_functions
branch
from
June 8, 2025 06:30
1a93b02 to
5ebf5dc
Compare
tompng
force-pushed
the
implement_major_math_functions
branch
2 times, most recently
from
June 20, 2025 18:56
f29ba89 to
316d713
Compare
mrzasa
reviewed
Jun 20, 2025
| return BigDecimal::NAN if x.nan? | ||
| return BigDecimal::INFINITY if x.infinite? == 1 | ||
|
|
||
| prec2 = prec + BigDecimal.double_fig * 3 / 2 |
Contributor
There was a problem hiding this comment.
Just curious: why do we decide what prec2 is needed? It differs between the functions and I'm wondering how it's calculated.
Member
Author
There was a problem hiding this comment.
Normally, BigMath functions calculate with prec+BigDecimal.double_fig precision.
I think BigMath.log2(1024, prec) is expected to return exactly 10. To calculate exact value for 2**n numbers, we need to round the result to precision = prec+BigDecimal.double_fig.
log(x)/log(2) should be calculated with prec + BigDecimal.double_fig + extra precision.
I decided to use extra=BigDeciaml.double_fig/2 here.
tompng
force-pushed
the
implement_major_math_functions
branch
from
June 21, 2025 08:05
316d713 to
a2f13fa
Compare
tompng
force-pushed
the
implement_major_math_functions
branch
from
June 30, 2025 11:10
a2f13fa to
4385bbd
Compare
tompng
force-pushed
the
implement_major_math_functions
branch
2 times, most recently
from
July 19, 2025 15:01
1c37330 to
f9b5a97
Compare
tompng
force-pushed
the
implement_major_math_functions
branch
4 times, most recently
from
September 12, 2025 18:50
db1b12f to
9c9313b
Compare
tompng
marked this pull request as ready for review
September 12, 2025 18:54
tompng
force-pushed
the
implement_major_math_functions
branch
2 times, most recently
from
September 13, 2025 13:30
6eb4231 to
3c3b34b
Compare
tompng
force-pushed
the
implement_major_math_functions
branch
from
September 24, 2025 06:53
3c3b34b to
9eb6fc0
Compare
tompng
force-pushed
the
implement_major_math_functions
branch
2 times, most recently
from
October 9, 2025 16:17
c02fb7b to
e37f42b
Compare
mrkn
approved these changes
Oct 28, 2025
mrkn
force-pushed
the
implement_major_math_functions
branch
from
October 28, 2025 08:40
e37f42b to
455cc8b
Compare
ksss
added a commit
to ksss/rbs
that referenced
this pull request
Dec 17, 2025
ksss
added a commit
to ksss/rbs
that referenced
this pull request
Dec 17, 2025
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement these methods
Remaining methods