I came across a piece of code in a project that I'm working on that looks scary. It is assumed that it displays a +/- delta between two numbers, but uses >strings to compare numbers instead of numbers.
I assume the code is working as expected at the moment, so I'm just trying to figure out how Ruby compares these strings in this case.
Here is an example of variable substitution:
if '55.59(100)' > '56.46(101)'
delta = '+'
else
delta = '-'
end
source
share