Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Math functions #45

Open
guruthree opened this issue Jun 25, 2018 · 0 comments
Open

Math functions #45

guruthree opened this issue Jun 25, 2018 · 0 comments

Comments

@guruthree
Copy link
Contributor

I've been thinking that some math functions could be useful, even if they are limited by the short int integer format. I'm happy to write these myself, but thought it'd be worth getting some feedback before implementation. I'm currently thinking of the following:

  • SQRT(x) for square roots
  • POW(x,y) for exponents (x^y)
  • MOD(x,y) for modulus or division remainder (e.g. returns 2 for 8 % 3)
  • SIN(x), COS(x), TAN(x) for sine/cosine/tangent where x is in degrees and the output is returned as -127 to 127 mapping to -1 to 1
  • ASIN(x), ACOS(x), ATAN(x) for arcsine/arccos/arctangent taking -127 to 127 and returning 0 to 360.

I see #33 mentions MIN and MAX already, otherwise I would add these to my list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant