%g is not lossless for single precision floats - %.9g is (other than distinguishing NaNs, who cares).
oprintf("fn:%s", m_name.c_str());
break;
case TYPE_FLOAT:
- oprintf("%g", m_constval.vfloat);
+ // %.9g is lossless for IEEE single precision.
+ oprintf("%.9g", m_constval.vfloat);
break;
case TYPE_VECTOR:
- oprintf("'%g %g %g'",
+ oprintf("'%.9g %.9g %.9g'",
m_constval.vvec.x,
m_constval.vvec.y,
m_constval.vvec.z);