-
Notifications
You must be signed in to change notification settings - Fork 117
Fix for #1799 #1807
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
base: horizon
Are you sure you want to change the base?
Fix for #1799 #1807
Conversation
- Extra arg removed for BigInteger.prototype.{round,roundEven,tan,atan,cos,sin,expt,acos,asin} - bnpExp() should take errbacks arg and use it if exponent too large - bnModPowInt() should take errbacks arg and pass it along to bnpExp() - bnPow() should take errbacks arg and pass it along to bnpExp()
@ds26gte , the fact that the tests above have passed, without this PR including any new tests at all, indicates a certain lack of testing coverage of the functionality being changed, yes? At minimum, please add regression tests for every function whose behavior now really ought to trigger a proper Pyret error, and make sure that it actually does so. |
…rownplt#1799. In fact, it doesn't give up at all, because any argument that doesn't blow memory necessarily has a tractable logarithm.
I've now improved the definition of
Indeed
(We can tighten these values considerably (using Racket as a comparison point), by changing the Previously these caused roughnum overflows (or before my recent changes, failed to invoke the Unfortunately or (I think) fortunately, with the latest fix to I've added a test that shows I've also added a test that shows Note that js-numbers already had explicit conditional tests bracketing the domain for |
…cos,tan} brownplt#1799 - num-{acos,asin,atan} don't have opportunity to trigger errbacks in method, so incorrectness (since corrected) was benign - num-{exp,expt} now show proper error (previous error was incorrect convergence, didn't even trigger errbacks) - num-log now always converges for convergent input (errbacks correctly propagated now, but impossible to trigger)
I've done so. Note that because of the way the non-method function and its method counterparts are written (e.g.,
This PR should go in sooner rather than later because it addresses numerical misbehavior that is immediately visible to the user. |
I'm trying to understand the meaning of the “firstFew” here. I think the idea is that in a number like
Taking the log, which produces a How much have we tested the boundary there/how can I be confident about or understand that boundary better? |
- test-numbers: use Racket value for log of large number in check block
At that point in the code, the incoming number is very large. If it had been had convertible to a fixnum, we would have already taken the JS log of the fixnum. But now, since it's so large, we can ignore its fractional part and view it as a big integer We can rewrite it as The "string" length of Our choice of |
Uh oh!
There was an error while loading. Please reload this page.