Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
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
--- /dev/null
+0
+1
+10
+10
+15
+2560
+256
+2748
+0
+1
+a
+10
+a00
+100
+abc
--- /dev/null
+print "0".to_hex
+print "1".to_hex
+print "a".to_hex
+print "A".to_hex
+print "F".to_hex
+print "A00".to_hex
+print "0100".to_hex
+print "ABC".to_hex
+
+print 0.to_hex
+print 1.to_hex
+print 10.to_hex
+print 16.to_hex
+print 2560.to_hex
+print 256.to_hex
+print 2748.to_hex