Is the inverse of std::numeric_limits::infinity() zero?

  • A+
Category:Languages

Short question: is there anything in the C++ standard (or the IEEE 754 floating-point standard) that guarantees that 1./std::numeric_limits<double>::infinity() is zero (or at least a small number)?

 


Any finite number divided by infinity results in zero under IEEE 754 (and therefore the same in most typical C++ implementations).

Comment

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: