4 ms·
Does it? The only thing it does I am aware of that it does differently is decide between negative or positive infinity, which doesn't exist for integers.
by LinAGKar 5y ago
Does it? The only thing it does I am aware of that it does differently is decide between negative or positive infinity, which doesn't exist for integers.
- thaumasiotes 5y agoNegative zero doesn't exist for integers either. (Note also that -0 is an additive identity, and +0 isn't.)
- regularfry 5y ago> Note also that -0 is an additive identity, and +0 isn't. Wait what That's really confused me. Is this purely with reference to addition operations as defined in IEEE-754, or is there an underlying mathematical reasoning that makes it make sense?
- thaumasiotes 5y agoIn the underlying mathematics, the only additive identity is zero, which is neither positive nor negative. IEEE-754 has signed infinitesimals instead, so it can't follow that. You just have to pick one to be the identity, and they picked -0. I assume the reasoning was that they would prefer values to be +0 when possible. Assigning the sum of -0 and +0 to be +0 instead of -0 means that -0 is the identity and +0 isn't.
- LinAGKar 5y agoUnless you're on a machine which uses one's complement or ign + magnitude, which C currently allows. Luckily, C is moving to make two's complement mandatory.
- deleted 5y ago[deleted]