diff --git a/gui.js b/gui.js index 4100ab2..c7e2b8a 100644 --- a/gui.js +++ b/gui.js @@ -10,7 +10,7 @@ const properties = {}; const numeralSystems = [ {name: "Binary", base: 2, length: 8, top: 125}, - {name: "Octal", base: 8, length: 3, top: 150, prefix: "\\"}, + {name: "Octal", base: 8, length: 3, top: 150, prefix: "0o"}, {name: "Hexadecimal", base: 16, length: 2, top: 175, prefix: "0x"}, ]; @@ -131,6 +131,8 @@ function drawNumeral({name, base, length, top, prefix}) { result *= -1; result ^= 0xFF; ++result; + // Force octal numbers to begin with 7 + result |= (base === 8) ? 0o700 : 0; } } diff --git a/index.html b/index.html index 4759f8c..693cf45 100644 --- a/index.html +++ b/index.html @@ -2,6 +2,11 @@