Skip to content

Bias toward nearest whole percentage#128

Open
andeston wants to merge 3 commits intoHummer12007:fracfrom
andeston:bugfix/refactor-calc
Open

Bias toward nearest whole percentage#128
andeston wants to merge 3 commits intoHummer12007:fracfrom
andeston:bugfix/refactor-calc

Conversation

@andeston
Copy link
Copy Markdown
Contributor

Summary

Fixes consistency issues for devices with low precision when adding or subtracting percentages.

Fixes #118

Behavior

Before

$ ./brightnessctl -m --frac s 50%
amdgpu_bl1,backlight,128,50.2%,255
$ ./brightnessctl -m --frac s 10%+
amdgpu_bl1,backlight,154,60.39%,255
$ ./brightnessctl -m --frac s 10%+
amdgpu_bl1,backlight,180,70.59%,255
$ ./brightnessctl -m --frac s 10%+
amdgpu_bl1,backlight,206,80.78%,255
$ ./brightnessctl -m --frac s 10%+
amdgpu_bl1,backlight,232,90.98%,255

After

$ ./brightnessctl -m --frac s 50%
amdgpu_bl1,backlight,128,50.2%,255
$ ./brightnessctl -m --frac s 10%+
amdgpu_bl1,backlight,153,60%,255
$ ./brightnessctl -m --frac s 10%+
amdgpu_bl1,backlight,179,70.2%,255
$ ./brightnessctl -m --frac s 10%+
amdgpu_bl1,backlight,204,80%,255
$ ./brightnessctl -m --frac s 10%+
amdgpu_bl1,backlight,230,90.2%,255

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant