-
Notifications
You must be signed in to change notification settings - Fork 103
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
NaN and Infinity not allowed #148
Comments
BTW, if you like the idea, i can maybe try to do a PR. Tell me. |
I'm not sure to understand your use case? You would prefer to see Even if it's not by design, I think it's better for js-quantities to refuse |
Exactly, i would like to have NaN and infinity, because that's float values like any others. Javascript already handle this cases with rules which are part of standards, that's the principle of least astonishment. I am not really sure people are aware that operators could throw such exceptions, because it doesn't behave like javascript. But i understand your point. I am working on scientific software stack, i have to deal with such possibilities. But it's probably not a common use case. BTW I did play a bit to see how it behave in some side corners. I was able to trick with unitless quantities. Maybe there is some cases you would like to fix anyway (tested with version 1.7.6).
|
Hi,
While doing some tests, i found out that it is not possible to create quantities with NaN or Infinity.
I would like to know if it's an expected behavior.
I am working on a system with python server. So i try to see if i can transpose everything on both sides.
For example, here is with Pint.
I was guessing javascript was already propagating NaN and Infinity properly inside js-quantities.
What do you think?
The text was updated successfully, but these errors were encountered: