Conversation

Very angry to learn that zero times infinity is not zero. Things like this is why I can't respect mathematics

3
0
0

@eniko Interestingly, in JS:

> 1 * Infinity => Infinity
> 0 * Infinity => NaN

1
0
0

Honestly mathematics is the C of science. "What's zero times infinity?" "Not sure but you shouldn't be multiplying infinity because that's Undefined Behavior" fuck offffff

2
2
0

@eniko

Well, if you think about it, it's probably in the neighborhood of 0/0, right..?

But seriously, you got to work limits to answer questions like that.

0
0
0

@eniko The correct answer to "What's zero times infinity?" is "It depends, I need more info to be able to answer", not "it is undefined" 😉

0
0
0

@eniko once upon a time I expressed astonishment to a mathematician friend that IEEE floating point math produced an inf for (nonzero)/0 because back in college I remembered a math professor being very adamant than dividing a number by zero doesn't magically give you infinity.

My mathematician friend replied, cool as cucumber soup, "really it depends on how you define division".

So there you go! All things are arbitrary! You are free now from the shackles of mathematic pedantry!

2
0
0

@eniko Also 0 * inf = NaN is definitely IEEE's fault. NaN should have never been made a number.

4
0
0

@aeva @eniko x87 used to have two modes - affine and projective. In projective mode, there was only one zero (yay!) but that also means there's only one infinity, i.e. 1/0 and -1/0 both gave the same infinity - it's the infinity where parallel lines meet, which of course lives at "both ends" of the number line.

Sadly this mode was retired a while ago, and now it's stuck in affine mode, so you get two infinities, and irritatingly, two zeros to match. Boo.

0
1
0

@aeva @eniko it isn't 😛

Also TIL about more cursed floating point nonsense. Thanks

0
0
0

@aeva risc-v returns 0xFFFFFFFF for x/0 and I think that's the only right and proper way to handle it

1
0
0

@eniko @aeva so it returns the closest thing to infinity in integer math?

1
0
0

@oblomov @aeva yup. It's because risc-v aims to be as simple as possible as an ISA, and the most basic set of instructions doesn't have any that trap, so if they made division by zero trap then they'd force everyone using only basic risc-v to deal with trap handling and they didn't wanna do that. Setting all the bits also apparently leads to the simplest circuitry

0
0
0