Open soshimee opened 2 years ago
I’m not sure if PI
is exposed in the API,† but you can get one from e.g. Decimal.atan(1).times(4)
. Once you have a representation of π you can convert to/from degrees by multiplying/dividing by π/180
†: If not, it probably should be, https://github.com/MikeMcl/decimal.js/blob/master/decimal.js#L32 defines it to 1025 digits and https://github.com/MikeMcl/decimal.js/blob/master/decimal.js#L3168 is a helper function that makes a Decimal out of it.
@soshimee
What makes you think it is not possible?
It is straightforward but I am not inclined to do the work for you.
Decimal.set({ precision: 100 });
pi = Decimal.acos(-1);
I need degrees for what I am doing, and radians won't work. Converting from radians to degrees with high accuracy doesn't seem to possible.