[math] Arithmetic module

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[math] Arithmetic module

ole ersoy
Hi,

I just published an arithmetic module / ArithmeticUtils repackaged. I would love to get some feedback on what you think of the exception design...any improvements...Do you think it could work for CM in general, etc?  The exception design strips localization, but it should be very easy to retrofit this within CM dependent applications due to the way each ExceptionTypes enum is coded.

https://github.com/firefly-math/firefly-math-arithmetic
https://github.com/firefly-math/firefly-math-arithmetic/blob/master/src/main/java/com/fireflysemantics/math/arithmetic/Arithmetic.java
Depends on:
https://github.com/firefly-math/firefly-math-exceptions

One thing that is non standard is that I'm documenting the exception type like this:

      * @throws MathException[NOT_POSITIVE]
      *             if {@code y < 0}.
      * @throws MathException[MAE__LONG_OVERFLOW]
      *             if the result would overflow.

Also one of the tests requires the RandomDataGenerator.
https://github.com/firefly-math/firefly-math-arithmetic/issues/1

I have not taken the time to understand this test yet, but would love it if it's possible to just generate and test with static data instead, assuming that's a valid approach...?

Cheers,
- Ole

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]