BlocSoc-iitr / HorseRiders

A complex math and Fast Fourier Transform Library for Huff and EVM Assembly
MIT License
8 stars 9 forks source link

⚙️ OPT: Increase accuracy of Complex functions #27

Open 0xpanicError opened 6 months ago

0xpanicError commented 6 months ago

⚙️ [OPTIMIZATION]

Description: Some tests in Complex.t.sol have low accuracy (upto none or one decimal place). Improve the accuracy to at least 3 decimal places (for now, ideally should be around 7-8 decimal places).

Objective: Optimise library and rewrite the following tests such that they have 3 decimal places of accuracy.

function testDivZ() public {}         // dont divide output by scale
function testCalcR() public {}        // dont divide output by scale
function testToPolar() public {}      // dont divide output by scale
function testPowZ() public {}         // have 3 decimals of accuracy instead of one

Source: ./test/Complex.t.sol