资 源 简 介
SLI (symmetric level-index) arithmetic essentially prevents overflow & underflow in computing. With this library, you may use "SLI" as a normal data type in C++. Replace "double" with "SLI" in you program, and over/underflow problem would be solved.
It supports operations including +, -, *, /, ==, !=, <,>, <=, >=, +=, -=, *=, /=, exp, log(base e, 2 & 10), pow, sqrt, sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, <<... Mixed operations with other data types also work.
The above operations were optimized as far as I could. A systematic testing was performed to ensure their correctness.
Some extended arithmetic operations were added later, such as the sum of N arguments, vector norm, and dot product.
Here are a few simple examples:
Example 1 -- 1.432e32 * 4.432e25
Code:
SLI a, b, c;a = 1.432e32;b = 4.432e25;c = a * b;cout << c << endl;