File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 3939#include < cstring>
4040#include < math.h> // for log, pow, abs
4141#include < cmath>
42+ #include < limits>
4243
4344// *****************************************************************************
4445// class member definitions
@@ -2928,11 +2929,13 @@ fmountlens[] = {
29282929
29292930 if (temp == 0 )
29302931 os << 0 ;
2932+ else if ( std::numeric_limits<float >::min () > temp && temp > std::numeric_limits<float >::max () )
2933+ os << " (" << value << " )" ;
29312934 else if ( (int (temp)/temp) > 0.999 )
29322935 os << int (temp);
2933- else if ( ( int (temp*2 )/(temp*2 )) > 0.999 )
2936+ else if ( std::numeric_limits< float >:: min () <= (temp* 2 ) && (temp* 2 ) <= std::numeric_limits< float >:: max () && (( int (temp*2 )/(temp*2 )) > 0.999 ) )
29342937 os << int (temp)*2 << " /2" ;
2935- else if ( ( int (temp*3 )/(temp*3 )) > 0.999 )
2938+ else if ( std::numeric_limits< float >:: min () <= (temp* 3 ) && (temp* 3 ) <= std::numeric_limits< float >:: max () && (( int (temp*3 )/(temp*3 )) > 0.999 ) )
29362939 os << int (temp)*3 << " /3" ;
29372940 else
29382941 os << std::setprecision (3 ) << temp;
You can’t perform that action at this time.
0 commit comments