-
Notifications
You must be signed in to change notification settings - Fork 742
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
DEBUG=true flag #246
Comments
Apologies for not responding at the time but I left this issue open for consideration. I don't want to add another setting but perhaps I should have made |
Hi Michael, I hope you're doing well. I wanted to follow up on this discussion regarding the As I see it, throwing error for invalid inputs (e.g Any updates or thoughts on this issue would be greatly appreciated. Lastly, thank you for all the work you’ve put into bignumber.js. - Pavan |
Hello I think the idea behind returning BigNumber NaN rather than throwing, was that instead of users having to Should I now change the API to always throw on invalid input? No, I don't think it's worth it. The demand isn't there. Similarly with I think it's numbers with more than 15 sig digs becoming BigNumber NaN that probably trips users up the most. I did get rid of that behaviour in my other library, so I could probably be persuaded to do that here as well. Basically, it someone wants change around this, they would need to do the thinking and come with exactly what changes should be made, and then I will consider their proposals, but I am not going to initiate change here myself. Thnaks for the feedback. |
Hi Micheal,
thanks for bignumber.js!
.DEBUG=true
is quite useful for additional validations before starting to calculate.Right now its available via
debug=true
- which sounds more like something that is not supposed to run in prod.Right now a few validations are run with it (NaN and exponentials afaik). Also, at some point maybe other debug functionalities are added, which makes me worry to use it right away.
Does something speak against a
THROW_ON_NAN
setting (just an example), maybe additional to the current debug mode?All the best,
Robert
The text was updated successfully, but these errors were encountered: