Not a Real Number (solved)
by rennie moffat · in Torque Game Builder · 04/05/2011 (9:21 am) · 3 replies
hi there,
I am wondering, in some of my calculations I am returned an inf value. In others, not a real number. If this is a case, is there a way for Torque Script to see that %variable is not a real number?
Thanks.
I am wondering, in some of my calculations I am returned an inf value. In others, not a real number. If this is a case, is there a way for Torque Script to see that %variable is not a real number?
Thanks.
About the author
My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.
#2
///other method.
function isInfinite(%var)
{
return (%var < mPow(10,-37)) && (%var > mPow(10,37))
}
\\\other method over.
Thanks.
04/05/2011 (10:57 am)
Thing is, %var is very fluid. It can change, continually on an instant. I will try your other method and keep you posted.///other method.
function isInfinite(%var)
{
return (%var < mPow(10,-37)) && (%var > mPow(10,37))
}
\\\other method over.
Thanks.
#3
04/06/2011 (8:01 am)
I just put in a "block", a call to say if this is not true, right before the key calculation and the problem has gone. Thanks.
Torque Owner Ivan Mandzhukov
Liman3D
{
return %var != %var;
}