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

Check our math operations #52

Closed
skx opened this issue Oct 17, 2022 · 0 comments · Fixed by #57
Closed

Check our math operations #52

skx opened this issue Oct 17, 2022 · 0 comments · Fixed by #57

Comments

@skx
Copy link
Owner

skx commented Oct 17, 2022

I've been reading this:

I see:

For example, (+ 1 2 3) is equivalent to (+ (+ 1 2) 3). With only one argument, + and * return the value; - returns its negation and / its reciprocal.9

That implies :

  • (/ 4) -> 1/4
  • (* 34) -> 34
  • (+ 21) -> 21

Right now the first won't work, though it seems by happy accident that the second two do work:

$ yal -e "(print (* 4))"
4
$ yal -e "(print (+ 32.4))"
32.400000

skx added a commit that referenced this issue Oct 17, 2022
We expect (/ x) to be equal to 1/x.  So (/ 3) is 0.333333...33

This closes #52.
@skx skx closed this as completed in #57 Oct 17, 2022
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

Successfully merging a pull request may close this issue.

1 participant