Quantcast
Channel: Answers for "Getting the same 'rounded' value of a Vector3?"
Browsing all 6 articles
Browse latest View live

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 Article


Answer 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 Article


Answer 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

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 Article

Answer 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 Article


Answer 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
Browsing all 6 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>