-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Adding more math constants (and a small correction to the description of an existing one) #9181
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo fix, missed an 'e'
@simdimdim
or
😉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when the CI will be happy, this looks good to me 👌
we have pi
and e
why not gamma
and phi
😋
Note
i'm just wondering if we should keep adding constants tomath
in the long run 🤔
maybenu_scripts
or the standard library might be a better fit later 👍
Well, ultimately we still have to wait for rust-lang/rust#103883 and I have no clue how to make the pull request conditionally depend on it. for the record
where can I do that? |
from inside a Nushell instance, from the root of the |
Hi @simdimdim thanks for your contribution. Since the pr is adding some math consts, I'd suggest to make it to be |
Hey o/, |
I'm fine with landing this if the ci gets green. We can figure out what to move to stdlib after this. |
well, that's it on my end I think. Now we just wait for the rust std to add PHI and EGAMMA to |
I don't get this. If PHI and EGAMMA aren't in std::f64::consts, why do we have this PR? We won't be able to land this if they don't exist because the CI won't be green and the code won't work, right? |
I've checked these consts in both stable and nightly doc, but it don't exists in both place, and I don't think they'll be added in forseen future. Are there any rfc or pr in rustc to add these constants? |
@WindSoilder, @fdncred , |
Oh, sorry for missing that message...Then I'll mark it as a draft. |
Just add these and be done with it, right?
|
That works too, should I do that instead? |
if you want to land this PR, i think it's the only way to move forward right now. |
@simdimdim Do you have time to update this PR with what is discussed above? |
clippy appears to be unhappy with the too many decimal places, should I also do as it suggests? |
I'm not sure of the ramifications but my first reaction is to do what you did and add an |
well, since it's meant to be only a temporary patch it shouldn't really matter (once the constants could be used directly from std) |
Thanks. It's fine for now. It's likely that some of these basic type math commands will be moved to our std lib anyway. |
Adding more float constants for when rust-lang/rust#103883 is accepted and merged. And fixing a small conflation in the description of the Euler number. Please take a look and let me know if I've missed or screwed up anything.