Anonymous's picture

Vector3d.Length casts result to float

Project:The Open Toolkit library
Version:1.0-beta-3
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

The implementation of Vector3d.Length looks like this:
return (float)System.Math.Sqrt(X * X + Y * Y + Z * Z);

Notice the cast to float, which shouldn't be there.


Comments

c2woody's picture

#1

Quote:

Notice the cast to float, which shouldn't be there.

Why should it be omitted? It's actually required since the return type is float.

the Fiddler's picture

#2

Status:open» confirmed

He's right, the return type for Vector3d.Length is double and the cast is a mistake. Will fix.

the Fiddler's picture

#3

Version:1.0-beta-2» 0.9.x-dev
Status:confirmed» fixed

Thanks for the bug report, fixed in r2585.

the Fiddler's picture

#4

Version:0.9.x-dev» 1.0-beta-3
Status:fixed» closed

Closing issues fixed in opentk-1.0-beta-3.