/fixed-point-unity

Primary LanguageC#MIT LicenseMIT

Fixed Point

GitHub package.json version GitHub last commit GitHub

Use Q31.32 format to represent fixed-point numbers.
This library is largely referenced from asik/FixedMath.Net, but fix and adjust some API for Unity usage.

Considered Q15.16 format before, but the resolution is only 2^-16 = 1.52587897E-5
This mean that it only provides 4 decimals of accuracy, which is unacceptable in many cases.