yes, indeed, it seems to be a compiler bug, cause I also tried it byspillerec wrote:but it seems like it is the compiler which easily messes up with scientific notification.
Code: Select all
// #define FLT_MAX 1E37
float FLT_MAX=1E37;
float max(float f1, float f2, float f3 = -FLT_MAX, float f4 = -FLT_MAX, float f5 = -FLT_MAX) {
float flarr[5], f;
flarr[0]=f1; flarr[1]=f2; flarr[2]=f3; flarr[3]=f4; flarr[4]=f5;
f=ArrayMax( flarr, 0, 5 );
return f;
}
task main() {
NumOut(0,8, max(7.1, 12.4, 5.9, 18.6)); // if it works, then NumOut does not display floats!
//NumOut(0,0, max(7.1, 12.4, 5.9, 1E+9)); // compiler error
for(;;);
}
it's not just always like the max thing passing the same vatiable types, what actually my goal is - it's more also having different numbers of parameters of different types, like how it is possible in the TextOut example:# Error: Invalid floating point operation
File "c:\Temp\temp.nxc" ; line 5
# FLT_MAX float 9.99999999999999954E36
#----------------------------------------------------------
# Error: Error parsing expression: FLT_MAX |
File "c:\Temp\temp.nxc" ; line 14
#
#----------------------------------------------------------
2 errors during compilation
Code: Select all
TextOut( char x, char y, string s(, optional: int textstyle));