An oddity with slider-adjusting float CVARs

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 a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: An oddity with slider-adjusting float CVARs

Re: An oddity with slider-adjusting float CVARs

by Blue Shadow » Fri Aug 05, 2016 10:17 am

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.

Re: An oddity with slider-adjusting float CVARs

by Graf Zahl » Fri Aug 05, 2016 8:02 am

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.

An oddity with slider-adjusting float CVARs

by Blue Shadow » Fri Aug 05, 2016 7:22 am

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.

Top