GNOME Bugzilla – Bug 778311
Temperature converter doesn't work with negative numbers
Last modified: 2017-02-13 20:30:20 UTC
Created attachment 345158 [details] gnome-calculator screenshot showing the problem Fedora 25 + GNOME 3.22.2 gnome-calculator-3.22.2-1.fc25 "20 degc in degf" works fine. "0 degc in degf" works fine. "−1 degc in degf" produces the following output: "unknown variable 'degc'"
This is a problem indeed. I have made an attempt to add the required parser changes (currently conversions only work for NUMBER UNIT IN UNIT token sequences), but it did not work. Adding PioneerAxon to CC, hoping he can give a hand here. If not, I will retry, I surely have missed something in my changes, maybe next time it will work out just fine.
Robert, I think I have figured out a way to solve this. I will first ensure that there are no regressions because of what I'm trying to do. Once I'm satisfied, I'll submit a patch. It's been long since I wrote the initial parser in C, so my memory is a bit rusty in this area.
Created attachment 345663 [details] [review] Fix unit conversion from negative constant numbers