Answer by ZweiD
that is a general problem in computing (see [Wikipedia on Floating Point Values][1]). the computer cannot 'really' display a 0.7, instead he saves that the number as something like 0.666879345....
View ArticleAnswer by senad
You could use an epsilon value to check if your float is inside a given range. For example: float espilon = .05f; if ( Math.abs(figure.y - .7f) < epsilon ) figure.y = .7f;
View ArticleAnswer by Eric5h5
I expect Vector3 just has a function like this: public override string ToString () { return "(" + x.ToString("f1") + ", " + y.ToString("f1") + ", " + z.ToString("f1") + ")"; } That's all, no magic or...
View ArticleAnswer by ZweiD
that is a general problem in computing (see [Wikipedia on Floating Point Values][1]). the computer cannot 'really' display a 0.7, instead he saves that the number as something like 0.666879345....
View ArticleAnswer by senad
You could use an epsilon value to check if your float is inside a given range. For example: float espilon = .05f; if ( Math.abs(figure.y - .7f) < epsilon ) figure.y = .7f;
View ArticleAnswer by Eric5h5
I expect Vector3 just has a function like this: public override string ToString () { return "(" + x.ToString("f1") + ", " + y.ToString("f1") + ", " + z.ToString("f1") + ")"; } That's all, no magic or...
View Article