Is there a negative zero?

后端 未结 2 680
醉梦人生
醉梦人生 2021-01-14 18:28

I\'m coding a simple calculator just to get started with iPhone dev. The thing is I have a (-) button thats supposed to negate whatever is put to the screen

2条回答
  •  一生所求
    2021-01-14 18:48

    float and double support -0 (which is different than 0 if memory serves). See here for more information, though I'm not convinced using -0 in your application will be particularly helpful for users. Do you have a compelling use case that requires it?

提交回复
热议问题