sswam
Advanced Member
- Joined
- Dec 16, 2009
- Messages
- 1,393
You're probably right, and it's not worth arguing about this, but ... I have nothing better to do ...Well you need to write the .f suffix to specify whether you wish to use a double or float number, consider : num / 12.0, do you wish to perform double precision division or single precision division here?I never write 10.0f. If the compiler isn't "optimizing it away", I should not be using such a piece of shit compiler.
MyFunction( 1.0f ) and MyFunction( 1.0 ) can call different pieces of code
If I'm dividing by an integer, I would normally write it like that: x / 12
Sometimes, rarely, I would write: x / 12.0 to cast x from int to float, it might would be better to do that differently.
I very rarely if ever divide by a non-integer literal value.
It's generally better to give those values a symbolic name, like: float x = 10.0
As for C++ overloading, pfft to that!
Last edited by a moderator: