diff --git a/changes.txt b/changes.txt index b6045624..a44ed7ee 100644 --- a/changes.txt +++ b/changes.txt @@ -1,5 +1,7 @@ Changes in version 1.3.1 (?? Mar 2007) + - Fixed a bug with negative exponents in fast_atof, posted by RVL + - renamed IAnimatedMeshSceneNode::getAbsoluteTransformation to getMD3TagTransformation to avoid conflicts with ISceneNode::getAbsoluteTransformation diff --git a/include/fast_atof.h b/include/fast_atof.h index 7a4f10e9..fadef58c 100644 --- a/include/fast_atof.h +++ b/include/fast_atof.h @@ -86,8 +86,14 @@ inline const char* fast_atof_move( const char* c, float& out) { ++c; //float exp = (float)strtol(c, &t, 10); + bool einv = (*c=='-'); + if (einv) + c++; + float exp = (float)strtol10(c, t); - + if (einv) + exp *= -1.0f; + f *= (float)pow(10.0f, exp); c = t; }