Quote:
Originally Posted by SimReality
Welcome to floating point inaccuracy.  On any computer that works in binary you will always see this when doing floating point arithmetic. The only way to solve it is use integers  . Something like:
int myVolume = 100;
MediaPlayer.Volume = myVolume / 100f;
string volume = "Volume: " + myVolume + "%";
Then you'll always see an even number displayed as a percentage of the volume. But basically when it comes to floating point math on a computer, you are never guaranteed for it to be exact. That's just how it is.
|
Thanks!
Worked awesome!
Quote:
Originally Posted by Tiptup300
And for the record .9 repeating == 1
|
If you did mean to put == (2 of them) there,
Yes I suppose that would work...
But that's a hell of a lot of code because it did it for every increment.