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

Unexpected pow(x,y) behavior #132

Open
PesBandi opened this issue Jan 6, 2025 · 1 comment
Open

Unexpected pow(x,y) behavior #132

PesBandi opened this issue Jan 6, 2025 · 1 comment

Comments

@PesBandi
Copy link

PesBandi commented Jan 6, 2025

For some reason pow(x,y) does y^x, for example pow(1,8) = 8 and pow(2,3) = 9. This does not seem to be expected behavior, as the docs specify it the usual way:

x = pow(2, 3) // 8

@FlorianRappl
Copy link
Owner

Yeah I think this is a problem with the docs.

pow behaves as other binary functions (e.g., add, sub etc.) in a way that it has reversed arguments to ease currying.

As we introduced the placeholder _ to forward args this is no longer needed. Still, for backwards compatibility I'd leave it as-is for the standard operators. For pow itself we can change it as the docs stated otherwise.

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

No branches or pull requests

2 participants