Representation FunctionsNormally the output of calculations is given as a decimal value. You can use the Representation Functions to get results represented in another way Binary, Decimal, Hexadecimal, Octal or as a Fraction. The Representation Functions doesn't actually perform a calculation, they just specify the representation of the value in the Workarea.
Important for the representation of numbers in other numeral systems is the system variable Bytes and the option Show leading zeros.
More about numeral systems is explained on the page Numeral Systems. To get results in another representation by default you can change the System variable Representation.
OverviewThe following functions are available for other representations of your results.
'Examples of using Representation Functions ' Specify the type of representation by enclosing ' the line with a function Fraction, Bin, Dec, Hex or Oct Fraction(0.4) Ans = 2/5 Fraction(0.125) Ans = 1/8 Fraction(2/5 + 3/7) Ans = 29/35 Bin(3 + 18 * 2) Ans = 0b100111 Hex(26) Ans = 0x1A Hex(15) Ans = 0xF Hex(255) Ans = 0xFF Hex(65340) Ans = 0xFF3C 0xFF3C Ans = 65340 Oct(13) Ans = 0o15 Oct(120 + 5) Ans = 0o175 ' The specification of the desired representation is lost when ' you perform an operation after the conversion. Bin(24 + 2) Ans = 0b11010 Bin(24) + 2 Ans = 26 'the binary system has two symbols, "0" and "1", and counts as follows: Bin(0) Ans = 0b0 Bin(1) Ans = 0b1 Bin(2) Ans = 0b10 Bin(3) Ans = 0b11 Bin(4) Ans = 0b100 Bin(5) Ans = 0b101 Bin(6) Ans = 0b110 Bin(7) Ans = 0b111 Bin(8) Ans = 0b1000 Bin(9) Ans = 0b1001 Bin(10) Ans = 0b1010 'etcetera ...
See AlsoFunctions Overview, Numeral Systems, Settings