lib: fix conversion of hex char to int and add test
[nit.git] / lib / standard / kernel.nit
index b9ce5e8..bdfd05c 100644 (file)
@@ -462,7 +462,7 @@ universal Char
                else if is_digit then
                        return self.ascii - '0'.ascii
                else
-                       return self.to_lower.ascii - ('a'.ascii + 10)
+                       return self.to_lower.ascii - 'a'.ascii + 10
                end
        end