0x4E4F@sh.itjust.works to linuxmemes@lemmy.worldEnglish · 6 months agoBro tried to divide by zerosh.itjust.worksimagemessage-square23fedilinkarrow-up1466arrow-down111
arrow-up1455arrow-down1imageBro tried to divide by zerosh.itjust.works0x4E4F@sh.itjust.works to linuxmemes@lemmy.worldEnglish · 6 months agomessage-square23fedilink
minus-squarebequirtle@lemmy.worldlinkfedilinkarrow-up7·6 months agobut it does apply, because computers use IEEE arithmetic…
minus-squareNeatNit@discuss.tchncs.delinkfedilinkarrow-up1·6 months agoTo be fair, it turns out not all environments implement floating-point arithmetic by the IEEE spec, meaning division by 0 can produce different results depending on where you run it. So in C++ float division by zero is undefined: https://stackoverflow.com/questions/42926763/the-behaviour-of-floating-point-division-by-zero But I’m fairly sure (note: based on literally no research) that most environments today will behave like the IEEE spec.
but it does apply, because computers use IEEE arithmetic…
To be fair, it turns out not all environments implement floating-point arithmetic by the IEEE spec, meaning division by 0 can produce different results depending on where you run it. So in C++ float division by zero is undefined: https://stackoverflow.com/questions/42926763/the-behaviour-of-floating-point-division-by-zero
But I’m fairly sure (note: based on literally no research) that most environments today will behave like the IEEE spec.