We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0a0e838 commit 04362e4Copy full SHA for 04362e4
values.cc
@@ -637,10 +637,11 @@ void LLScriptTypecastExpression::determine_value() {
637
{
638
double d;
639
float f = 0.0f;
640
- sscanf( ((LLScriptStringConstant *)value)->get_value(), "%lf", &d );
641
- f = (float)d;
642
- if (mono_mode && (d > -1.1754943157898259e-38 && d < 1.1754943157898259e-38))
643
- f = 0.0f;
+ if ( sscanf( ((LLScriptStringConstant *)value)->get_value(), "%lf", &d ) == 1 ) {
+ if ( !mono_mode || (d <= -1.1754943157898259e-38 || d >= 1.1754943157898259e-38) ) {
+ f = (float)d;
+ }
644
645
constant_value = new LLScriptFloatConstant(f);
646
}
647
break;
0 commit comments