#what's the appropriate way to check if a float can be converted to integer?

1 messages · Page 1 of 1 (latest)

unreal lilyBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

vague hawk
#

They are both 4 bytes. Float to integer is always possibile without problems. Integer to float is not always good because float has the integer range reduced

vague hawk
#

Why

#

Whats the problem

livid depot
#

"float has the integer range reduced" is not true

#

float can represent values that are out of range for int

vague hawk
#

In the mantissa part?

#

They are both 4 bytes, the semantic value wont be preserved

#

You can convert it directly but you wont get the same number

#

Because bytes are not used in the same wat

#

Way

livid depot
#

ok you are not helping because you don't know what you are talking about

vague hawk
#

Maybe i didnt understand the question