Number Systems
Octal Plus One
Add a decimal integer to an octal value.
0o17 is 1·8 + 7 = 15. Adding 1 gives 16, which is 0o20. Octal digits stop at 7, so 17 + 1 rolls to 20 in base 8.
Prefixes select the base before any arithmetic happens. A digit that does not belong in that base is an error. In this workflow a caret would mean XOR. The decimal value is shown beside the prefixed result when both are meaningful.
Equation
0o17 + 1
How the base is chosen
Number-system examples treat a prefixed token as an integer in a base. 0b is binary, 0o is octal, and 0x is hexadecimal. Inside one of these expressions, a caret is bitwise XOR, not a power. AND, OR, XOR, and shifts act on the bits after the values are converted.
DGS checks the digits before it converts, so a digit that does not exist in that base is an error rather than a silent change. A result can show both the prefixed form and the decimal value. The walk-through on this page uses the same place values.
Reading the input
0o17 + 1— This line is part of the example input and is sent to DGS unchanged.
Try a change
- Edit one number in the field, then use Solve Equation. The studio opens on the homepage with the edited text and runs it.
- Use Open in DGS Studio when you want the expression loaded but not run yet.
Solve Equation opens the original input in the equation workspace and displays its symbolic results, conditions, and solution steps.