BlocSoc-iitr / HorseRiders

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

corrected some typos to make the code clean and added two macros #23

Closed amsorrytola closed 6 months ago

amsorrytola commented 7 months ago
  1. in complex.huff the add function should take 4 values but it was written take(0) similarly it should be written return(2). It doesnt affect the working of code .
  2. added an function in complex.huff that takes a complex number and angle by which it should rotate it and returns the rotated complex number.
  3. added another function that takes two complex numbers as input and returns the equation of a line that passes through it.
0xpanicError commented 6 months ago

Hey @mohammed-talha-ansari Thanks for contributing and working on this repository. Can you also add some unit tests for the function you wrote to ensure that it is implemented correctly? You can refer the tests written in src/test Thanks!

0xpanicError commented 6 months ago

This change doesn't affect macro implementation due to the stack being the same but logically, macro definition should contain 4 instead of 0.

Then shouldn't it return 2 values as well? Also is this trend followed in all functions?

blueh4mster commented 6 months ago

This change doesn't affect macro implementation due to the stack being the same but logically, macro definition should contain 4 instead of 0.

Then shouldn't it return 2 values as well? Also is this trend followed in all functions?

Yes, like I said what happens in the macro definition doesn't affect the actual working of the function but for clean and quality code writing, it is indeed a typo and should be takes(4) returns(2). As for the other functions, I've checked that they don't have this typo.

0xpanicError commented 6 months ago

This change doesn't affect macro implementation due to the stack being the same but logically, macro definition should contain 4 instead of 0.

Then shouldn't it return 2 values as well? Also is this trend followed in all functions?

Yes, like I said what happens in the macro definition doesn't affect the actual working of the function but for clean and quality code writing, it is indeed a typo and should be takes(4) returns(2). As for the other functions, I've checked that they don't have this typo.

Okay. @mohammed-talha-ansari can you also make the above change as mentioned by Preeti in this PR?