130
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
this post was submitted on 12 Mar 2024
130 points (94.5% liked)
Asklemmy
43027 readers
1399 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
- !lemmy411@lemmy.ca: a community for finding communities
~Icon~ ~by~ ~@Double_A@discuss.tchncs.de~
founded 5 years ago
MODERATORS
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...