Game Development Community

Anything like (std::numeric_limits<float>::max)() ??

by Tejaswin · in Torque Game Builder · 08/10/2010 (5:54 am) · 3 replies

Hi,

I need the max and min values of the basic datatypes like int,float. Is there any function/method that gives this in TGB like in C++ we have (std::numeric_limits<float>::max)() - which gives the max value for float.

Thanks in advance,
Tejaswin.

#1
08/10/2010 (12:03 pm)
If your are referring to torquescript, then no. There is no equivalent function, since all variables in script are actually strings. If you plan on doing anything that requires alot of mathematical processing then you should write it in C++ and call it through a console function in script.

edit: If all you want is to find the max or min between two values then Patrick is correct...but if you are looking for the Max value that a float or int data type can have then no (since there are no data types in torquescript).
#2
08/10/2010 (2:26 pm)
There are some basic math operations in TorqueScript here
#3
08/11/2010 (9:20 am)
I was looking for the max value float can take in TGB, but now I understand that it is not possible as everything is taken as String.

Thanks for the comments and the link.