Khronos public bugtracker – Bug 115
<float_array> magnitude attribute shouldn't allow negative values
Last modified: 2014-01-07 10:23:10 PST
Email on collada mailing list Feb 9 2009 between Robert Wurfel (netallied) and Mark Barnes:
Robert: I am wondering what exactly the meaning of the magnitude attribute of the <float_array> element is. The COLLADA Spec 1.5 says:
"The largest exponent of the floating-point values that can be contained in the array. The maximum value is 308; the minimum is -324. The default is 38." But this would only make sense to me, if the absolute value of the exponent is meant. Than the default would mean, that the values would be restricted to single precision floating point numbers (floats in c++) and the maximum value would allow all double precision floating point numbers (doubles in c++).
Mark: Yes that is the intended meaning of the range of values for that attribute. The attribute name wasn't chosen for a strict mathematical definition of "magnitude", just "larger or smaller sizes".
Robert: But if the absolute value is meant, what does "the minimum is -324" mean in the description?
Mark: I think I see the problem. The spec implies the range of array values can be very asymmetrical because it allows negative values for magnitude. I think you have found a schema and spec bug since that is not the intent and the value should only be non-negative in the range [0,308]. It's a hint as to what to expect as the max value within the array and guide your implementation (float vs double vs my-number-class). I don't think allowing negative magnitude values helps make that implementation choice. For example e-324 and e+308 both choose doubles.