Float values in settings are too precise (especially for people who don't know IEEE854) #1866

Closed
opened 2026-01-30 22:40:29 +00:00 by claunia · 4 comments
Owner

Originally created by @hugo-vrijswijk on GitHub (Jun 22, 2019).

Originally assigned to: @zadjii-msft on GitHub.

Environment

Windows build number: Microsoft Windows [Version 10.0.18362.175]
Windows Terminal version (if applicable): 0.2.1715.0

Any other software? No

Steps to reproduce

  1. Open settings
  2. Set acrylicOpacity to 0.7
  3. Close Terminal
  4. Open terminal again
  5. Observe acrylicOpacity setting now being set to 0.69999998807907104

Expected behavior

acrylicOpacity should remain on 0.7

Actual behavior

acrylicOpacity has a floating point error.

Originally created by @hugo-vrijswijk on GitHub (Jun 22, 2019). Originally assigned to: @zadjii-msft on GitHub. # Environment ```none Windows build number: Microsoft Windows [Version 10.0.18362.175] Windows Terminal version (if applicable): 0.2.1715.0 Any other software? No ``` # Steps to reproduce 1. Open settings 2. Set `acrylicOpacity` to `0.7` 3. Close Terminal 4. Open terminal again 5. Observe `acrylicOpacity` setting now being set to `0.69999998807907104` # Expected behavior `acrylicOpacity` should remain on `0.7` # Actual behavior `acrylicOpacity` has a floating point error.
claunia added the Area-SettingsIssue-BugResolution-DuplicateProduct-Terminal labels 2026-01-30 22:40:29 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Jun 24, 2019):

jsoncpp's default floating point precision is a little too ... precise. Probably something we can constrain.

@DHowett-MSFT commented on GitHub (Jun 24, 2019): *jsoncpp*'s default floating point precision is a little too ... precise. Probably something we can constrain.
Author
Owner

@Willsatroyd commented on GitHub (Jun 27, 2019):

This behaviour can be observed for any values other than 0.25, 0.5, 0.75 or 1.

@Willsatroyd commented on GitHub (Jun 27, 2019): This behaviour can be observed for any values other than 0.25, 0.5, 0.75 or 1.
Author
Owner

@DHowett-MSFT commented on GitHub (Aug 8, 2019):

Should we just switch these things to integral percent?

@DHowett-MSFT commented on GitHub (Aug 8, 2019): Should we just switch these things to integral percent?
Author
Owner

@zadjii-msft commented on GitHub (Sep 16, 2019):

So this hasn't been technically fixed. However, I believe it's been practically fixed by #2475. Since we're no longer in the business of serializing the user's settings, then we won't be serializing floats incorrectly anymore.

@zadjii-msft commented on GitHub (Sep 16, 2019): So this hasn't been _technically_ fixed. However, I believe it's been _practically_ fixed by #2475. Since we're no longer in the business of serializing the user's settings, then we won't be serializing floats incorrectly anymore.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1866