Skip to main content
gamedev.net
🔒 Locked

int to float

Started by cow_in_the_well 1 reply 550+ views
Knarkles
Knarkles
No, that''s not all it has to do, because floats are stored in a totally different way than integers. But yes, I think it''s still faster that way round, I don''t know by how much.

-Jussi
Ironblayde
Ironblayde
I''m not sure, but I''m guessing that it would be about the same. Converting an integer to a float, like Selkrank said, is more than just tacking on a decimal point. Floats are stored as a biased exponent, a sign bit, and a mantissa; so it seems to me that converting int->float and float->int would take about the same amount of time, since it''s all the same steps, only taken in reverse. Just a guess.

-Ironblayde
 Aeon Software
"Your superior intellect is no match for our puny weapons!"

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.