It doesn't round, it discards (or truncates) the decimal part.gotenks wrote:ANY computer casting (to an int type number, eg non floating point) rounds down...
1.9 => 1
-1.9 => -1
Moderators: Forum moderators, developers
Yes, but kids who know C know that converting a float to an integer type doesn't necessarily round.ouroboro wrote:< .5 rounds down. >= .5 rounds up. every elementary school kid knows that.
gotenks wrote:float = float, unless you're using something i'm unaware of...byte = non-floatingpoint value
i would translate those values to an RGB of 178.5, 25.5, 25.5 - and i would round them to 179, 26, 26 (^J = #B31A1A).q_math.c wrote:{ 0.7f, 0.1f, 0.1f, 1.0 }, // J
The absence of "math.round" in the source doesn't prove anything (it's not a standard C function).gotenks wrote:so they're truncated... not rounded
mmmkay, so does this mean i win?Spoofeh wrote:The absence of "math.round" in the source doesn't prove anything (it's not a standard C function).gotenks wrote:so they're truncated... not rounded
That's beside the point though, since it looks to me like colours are float throughout cgame. Conversion is either done in the engine or the gfx driver/hardware (my guess).