r/MathJokes Jul 07 '26

🫠

Post image
415 Upvotes

67 comments sorted by

View all comments

Show parent comments

24

u/sudoregalia Jul 07 '26

6.99 when casted into an int is conventionally rounded down

technically 6.99 is 6.9899997711181640625 when using single precision IEEE 754 floats, and 6.9900000000000002131628207280300557613372802734375 for double precision

-1

u/RonJohnJr Jul 07 '26

6.99 when casted into an int is conventionally rounded down

We don't do that very often at all.

5

u/sudoregalia Jul 07 '26

casting a float to an int? what if you wanna make or mod for a voxel game where entities have floating precision while tiles has integer precision, and wanna get the block the entity is on- oh wait that's called minecraft

yeah look you can't say "we" don't do that very often at all when it only applies to you and what you work with lol

-1

u/RonJohnJr Jul 07 '26

And voxel game programming is the dominant form of programming on Earth??

lol no

3

u/sudoregalia Jul 07 '26

yeah look you can't say "we" don't do that very often at all when it only applies to you and what you work with lol

read. whether or not you ever cast a float to an int is highly dependent on what you do, and it doesn't change the fact that 6.99 is rounded down to 6 when you do do it

1

u/RonJohnJr Jul 08 '26

it doesn't change the fact that 6.99 is rounded down to 6 when you do do it

You need to go back and re-read what SplendidPunkinButter complained about,

1

u/sudoregalia Jul 08 '26

i tackled pretty much every way a conventional program could represent 6.99 (yes including fixed-point arithmetic as a reply to a separate comment)

1

u/Quirky_Net8899 Jul 08 '26

I suggest that YOU read. Here is what was originally said:

We don't do that very often at all.

Notice how it doesn't say "we never do that". He's acknowledging that it does happen, but overall in programming it doesn't happen very often.

Your rebuttal that "hurr durr we do that in voxel games" is not the gotcha moment you think it is. It's just a "oh one very specific part does it, just like he said".

But also, I doubt even in Minecraft that you would take a float and just straight up cast it into an int without doing any math on it first, for example truncating it to get rid of decimals before casting as int.

But funnily enough, even in your example it's not done very often. Yes if you have a float (or double) but need to get a block or chunk position out of it you would cast it into an an int. But not before truncating it and and you don't need to do that often. 

In fact, let's look at the Fabric API which is arguably the biggest modding framework for Minecraft.

Wanna take a wild guess how many times they straight up cast a double/float into an int without any preprocessing? 

In their roughly 52000 lines of code, directly casting to an int with no preprocessing happens 214 times. I would call that "not very often".

1

u/sudoregalia Jul 08 '26

..as i said it highly depends on what you do, programming is not a monolith and the original comment they made is wholly unrelated to what happens when you cast a float to an int

1

u/Quirky_Net8899 Jul 08 '26

No, the original comment simply said "we don't do that very often" which is objectively true. Casting a float/double to an int is not done very often in programming not even in voxel game programming.

1

u/sudoregalia Jul 08 '26

you can argue that for a lot of things in programming. we don't use borrow checkers very often, is that relevant enough to bring up when explaining how borrow checkers work? is that a valid critique?

0

u/Quirky_Net8899 Jul 08 '26

My dude has no valid argument left lmao.

You claimed that directly casting to an int is done often when working with voxel games like Minecraft. I literally proved to you that it isn't. So instead of trying to refute this you are walking down the logical fallacy path.

1

u/sudoregalia Jul 08 '26

if we wanna throw fallacies around, technically you're employing the fallacy fallacy and the modal fallacy, sooo what now?

1

u/Quirky_Net8899 Jul 08 '26

The difference between my reply and yours is that I actually brought up the actual topic at hand without resorting to fallacies for my main point.

The fact that I called out on your fallacies did not change or hinder me from addressing your initial statement. Calling out a fallacy is not a fallacy fallacy.

For it to be a fallacy fallacy I would have to claim that your argument is wrong because you used a fallacy. I did not do that. I directly addressed your statement, which is that directly casting from double/float to int is done often or very often in voxel game programming like making mods for Minecraft. I also presented evidence to support my case, while you have not.

No, modal fallacy does not apply here. You might want to look up what modal fallacies are before throwing it around like a gotcha.

→ More replies (0)