Tested with: 2.9pre-1183-ga893013 (32-bit)
I'm not sure what to make of this, so here is how to produce:
Open the menu. Go to Options->Sound Options. Adjust the value of the music volume option so that it's at 0.05. Now press the left arrow key once to lower that value to 0.00. Bring up the console and type the CVAR of the music volume option (snd_musicvolume) to print its value. You'll get a value like 8.19564e-09. If you press the left arrow key again and check the CVAR, its value will then be 0.
I used the music volume option just as an example, so don't think it's just that option.
An oddity with slider-adjusting float CVARs
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
-
- Posts: 5043
- Joined: Sun Nov 14, 2010 12:59 am
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49230
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: An oddity with slider-adjusting float CVARs
No, it's the simple fact that e.g. 0.05 is not representable as a floating point number, so there's inaccuracies creeping up. All this gets compounded by having single precision floats and no means for compensation in the printing routine.
-
- Posts: 5043
- Joined: Sun Nov 14, 2010 12:59 am
Re: An oddity with slider-adjusting float CVARs
Okay, understood.
Funny, I wouldn't have noticed this normally, but I was fiddling around with scaling the crosshair. I slid it all the way to the left to set its value to 0.00 (since 0 means "unscaled"), yet couldn't see the crosshair. Then I pressed the left arrow key again, and suddenly it appeared, because at that point the value was actually 0.
Funny, I wouldn't have noticed this normally, but I was fiddling around with scaling the crosshair. I slid it all the way to the left to set its value to 0.00 (since 0 means "unscaled"), yet couldn't see the crosshair. Then I pressed the left arrow key again, and suddenly it appeared, because at that point the value was actually 0.