Khronos Public Bugzilla
Bug 115 - <float_array> magnitude attribute shouldn't allow negative values
<float_array> magnitude attribute shouldn't allow negative values
Status: ASSIGNED
Product: COLLADA
Classification: Unclassified
Component: Schema
1.5.0
Macintosh Mac OS
: P3 normal
: Release 1.5.1
Assigned To: Fabrice Robinet
COLLADA Work Group email alias
:
Depends on:
Blocks: 116
  Show dependency treegraph
 
Reported: 2009-03-25 18:07 PDT by Ellen Finch
Modified: 2014-01-07 10:23 PST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ellen Finch 2009-03-25 18:07:54 PDT
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.
Comment 1 Mark Barnes 2011-03-11 18:23:09 PST
Assigned.