Is using increment (operator++) on floats bad style?

后端 未结 4 439
孤街浪徒
孤街浪徒 2020-12-08 10:45

Is it considered \"bad style\" to use the increment operator (++) on floats? It compiles just fine but I find it smelly and counter-intuitive.

The question: In what

4条回答
  •  被撕碎了的回忆
    2020-12-08 11:14

    There is nothing wrong with using ++ and -- on float or double operands. It simply adds or subtracts 1. That's what it's for!

提交回复
热议问题