4 ms·
It unfortunately fails my go-to test for these calculators: ≫ 7.8L/100km -> miles/gallon 7.8 L / 100 km -> mi / gal Conversion error: C
by matt4077 9y ago
It unfortunately fails my go-to test for these calculators:
≫ 7.8L/100km -> miles/gallon
7.8 L / 100 km -> mi / gal
Conversion error:
Cannot convert unit L/km (base units: m²)
to unit mi/gal (base units: m⁻²)
- yodon 9y agoThat's because your unit conversion is invalid. It's entirely possible to construct an equation that computes mi/gal from L/km (or from gal/mi for that matter), but the dimmensionalty of the two numbers clearly disagree. Yes, you can introduce scenarios like yours where "any human" would know what the intended meaning of the question is, but mathematically speaking it's incorrect and encouraging a calculator to perform mathematically incorrect operations is a recipie for both disaster and the introduction of student/user misunderstandings.
- Swizec 9y agoFor what it's worth, it works on google. https://www.google.com/search?q=5+l/100km+to+mpg&ie=UTF-8&oe=UTF-8&hl=en-us&client=safari https://www.google.com/search?q=5+l/100km+to+mpg&ie=UTF-8&oe...
- yodon 9y agoSure, because google isn't a calculator, it's an AI machine. Sometimes it guesses your intent right, sometimes it doesn't. That's fine for many tasks but not a great way to design a bridge or a steam boiler.
- sharkdp 9y agoYes, 100% agree with your comment. I'd rather have a calculator application that is maybe a little less "smart" in exchange for mathematical correctness and predictability.
- arnarbi 9y agoI don't remember which calculator did this (I think GNU units), but I've seen this handled automatically with a warning saying "Warning: reciprocal conversion"
- adrianmonk 9y agoYes, that's what GNU units does: $ units Currency exchange rates from www.timegenie.com on 2016-06-21 2926 units, 109 prefixes, 88 nonlinear units You have: 7.8L/10km You want: miles/gallon reciprocal conversion * 3.0155716 / 0.33161209 I think it's fine for a calculator to make guesses as long as it makes it very clear that it's doing so.
- nightcracker 9y agoThe dimensionality for your query is wrong. If you fix that it works just fine: ≫ 100km/7.8L -> miles / gal 100 km / 7.8 L -> mi / gal = 30.1557 mi/gal