3 ms·
(-0.) + (+0.) and (+0.) + (-0.) both evaluate to +0., as any compiler should readily confirm.
by pascal_cuoq 13y ago
(-0.) + (+0.) and (+0.) + (-0.) both evaluate to +0., as any compiler should readily confirm.
- T-hawk 13y agoIs the compiler calculating that at compile time based on the lexical tokens, or at runtime with native CPU floating point instructions? That absolutely matters.
- stephencanon 13y agoN.B.: Except in round-to-minus-infinity, in which case they evaluate to -0.