Manuals/calci/OCT2HEX

From ZCubes Wiki
Revision as of 10:14, 11 December 2013 by Swapna (talk | contribs)
Jump to navigation Jump to search

OCT2HEX(number, places)

  • Where 'number' is an octal number to be converted and
  • 'places' is the number of characters to be used to display the output.

OCT2HEX() converts an octal number to its hexadecimal equivalent.

Description

OCT2HEX(number, places)

For Example,

OCT2HEX("300,4") returns 00C0

OCT2HEX() returns

OCT2HEX() returns

  • The 'number' can be
  • Output is a 40 bit number. The most significant bit is the sign bit and remaining bits are magnitude bits.
  • If 'number' is negative, Calci ignores the places and returns a 10 character (40 bit) hexadecimal number.
  • If the 'number' is not an integer, Calci considers the integer part, and displays the output.
  • Calci displays an error message, if the 'number' is an invalid decimal number.
  • 'places' argument can be omitted. Calci displays the hexadecimal output with minimum number of characters necessary.
  • 'places' is used for padding the output with leading '0's'.
  • Calci ignores the 'places', if the output is more than mentioned 'places'.
  • Calci ignores the 'places', if the 'places' is non-numeric or negative.
  • If 'places' is not an integer, Calci truncates the 'places' value.
  • A number preceding with '0' (e.g. 0377) should be written in text format ("0377") to avoid confusion with hexadecimal numbers.

Examples

Function HEX Output
OCT2HEX("511")
OCT2HEX("433,3")
OCT2HEX("78,-4")
OCT2HEX("78.78")
OCT2HEX("-364")

See Also

References