You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Comparing the double values is not always a good idea, but why don't you use DEGREE_ANGLE in the NonSI unit system implementation from https://github.com/unitsofmeasurement/si-units?
There you will also find how it's done which is closer to the first approach but using precise enough values including the Rational number type instead of double or other primitives.
You'll also find JUnit tests for it. I close this here, if you found any problems with the SI units or suggestions for improvements, please create a new ticket there.
Hi there,
First of all, thank you for this library, it's a real joy to use!
I'm trying to add a new type "Degree" to represent an angle in degrees.
If I define the unit like this:
This does not produce the result that I expect (not even close), I get the following double value:
0.017453292519943295
.I also tried defined the unit like this:
But it produce the same result.
Now if I define the degree unit like this (thanks #257):
Everything works properly.
I tried debugging the converter method, but can't find why the first implementation is not working.
Why the first implementation is not working ? And is there a way to make it work ?
Thanks in advance
The text was updated successfully, but these errors were encountered: