Open Bug 2010486 Opened 6 hours ago Updated 6 hours ago

Imprecision in Imperial unit conversion

Categories

(Firefox :: Address Bar, defect)

Firefox 148
defect

Tracking

()

UNCONFIRMED

People

(Reporter: 1justinpeter, Unassigned)

References

Details

Typing "0.75lb to oz" in the address bar outputs "11.9999999999 oz". This should output "12 oz".

I'm not sure if this is classic floating point rounding, or if it is a result of the constant for ounce not being exactly 16x that of pound in https://searchfox.org/firefox-main/source/browser/components/urlbar/unitconverters/UnitConverterSimple.sys.mjs#146-149.

Depends on: 1697722

Actually, per Wikipedia (and verified with a few sources) the pound is defined as exactly 0.45359237 kg, so the constant listed in the file above is incorrect past about the 5th decimal place.

You need to log in before you can comment on or make changes to this bug.