Hey, stuck on something really simple here. I've got a simple line of code:
if classOf (variable01 - variable02) == integer then
(
print integer
)
else
(
print float
)
The problem being that when Max is given two integers it'll always round. If I supply the two variables as floats and it get number.0 then it'll still be a float class.
I must be missing something insanely obvious here, any help would be much appreciated.
Replies
If you are mixing floats with integers you always get float as a result. You can always explicit cast the result to a float or an integer.
I'm wanting the result to instead either be a integer (when it's an integer obviously) or a float (when it's a float).
I should have given this a different title to this.
Essentially the user is able to pick any two integers and I need to put a check to make sure they've picked two where one is divisible by the other.
Just beat me to it. :P
For future ref, see "Number Values" in the MaxScript help documents.