I get all these warnings about int being converted to float, and possible loss of precision. I don’t want to change all my int constants to floats. Why does this error appear? I thought float function parameters were promoted to double anyway? Why aren’t the arguments simply double?
Why can’t I pass a const Rectangle& where a const Rectangle& is expected? I thought they could be represented identically. For example, why can’t I do this:
Not much point in moaning about the way c++ handles types! I’ve never found it a problem though, it’s not exactly a big chore to have to type 1.0f instead of 1, and it makes it clear to the reader what’s going on.
You mean like Rectangle::toFloat() and Rectangle::getSmallestIntegerContainer() ?
Good question. I’m pretty sure there was a good reason, but that code’s very old and I can’t remember why I did it that way… Probably I was trying to remain compatible with an environment that didn’t have ceil() or something… It does look like something that I could update now.