Why does Gnu Octave have negative zeroes?

后端 未结 3 1491
孤城傲影
孤城傲影 2020-12-15 17:23

This is an odd one I\'m puzzled about. I recently noticed at the Gnu Octave prompt, it\'s possible to enter in negative zeroes, like so:

octave:2> abomin         


        
3条回答
  •  孤城傲影
    2020-12-15 17:46

    IEEE-754 floating point numbers have this property too. It might come in handy for limits and infinities. For example, the limit of 1/x with x → +∞ is 0, but the function approaches from the positive side of the axis, with x → −∞ the function approaches from the negative side so one might give the limit as −0, in that case.

提交回复
热议问题