c++ - Is floating point multiplication by zero guaranteed to produce zero? -


i understand floating point has rounding errors, i'm wondering if there situations error not apply, such multiplication 0 .

does 0 times number = 0 floating points ?

false:

0f * nan == nan 0f * infinity == nan 

and ...

0f * -1f == -0f (negative 0f), 0f == -0f :-) 

(on intel, vc++, , on platform uses ieee 754-1985 floating points)

example on ideone (that uses gcc on intel compatible platform probably)


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -