An oddity with slider-adjusting float CVARs

Bugs that have been investigated and resolved somehow.

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.
Post Reply
Blue Shadow
Posts: 5043
Joined: Sun Nov 14, 2010 12:59 am

An oddity with slider-adjusting float CVARs

Post by Blue Shadow »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: An oddity with slider-adjusting float CVARs

Post by Graf Zahl »

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.
Blue Shadow
Posts: 5043
Joined: Sun Nov 14, 2010 12:59 am

Re: An oddity with slider-adjusting float CVARs

Post by Blue Shadow »

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.
Post Reply

Return to “Closed Bugs [GZDoom]”