8-bit to 1024-bit mathematic library with overflow/underflow detection