this post was submitted on 12 Mar 2024
126 points (94.4% liked)
Asklemmy
43945 readers
25 users here now
A loosely moderated place to ask open-ended questions
Search asklemmy π
If your post meets the following criteria, it's welcome here!
- Open-ended question
- Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
- Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
- Not ad nauseam inducing: please make sure it is a question that would be new to most members
- An actual topic of discussion
Looking for support?
Looking for a community?
- Lemmyverse: community search
- sub.rehab: maps old subreddits to fediverse options, marks official as such
- [email protected]: a community for finding communities
~Icon~ ~by~ ~@Double_[email protected]~
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
As a mathematician, I donβt use any digits, but the symbol Ο.
As a computer scientist, same, but it's called
PI
.It's the computer that does the thing with the digits, not me. π
In which case you're probably using a predefined 64-bit floating point number, which I think is accurate to 15 digits.
Well, you know what's funny, after writing the comment above, I double-checked what the Ο constant is called in Rust, as that's what I'm mostly coding with these days.
And well, it actually makes you choose. There's
f32::consts::PI
andf64::consts::PI
. Which I guess, makes sense. If you're calculating with 32-bit floats, you should be aware that Ο is going to be less precise.So, yeah, I'm a hoax, computer scientists do need to decide between 32-bit and 64-bit.
In fact, the one time I needed Ο in Rust, was as a 32-bit float. I built a tiny gravity simulation in a game engine and game engines generally use 32-bit floats...
Iβd like to agree, but writing Ο with capital letters is heresy.
Yeah, math conventions and programming conventions don't always align. As in, basically never...