Difference between revisions of "Manuals/calci/BIN2OCT"

From ZCubes Wiki
Jump to navigation Jump to search
Line 23: Line 23:
 
*If 'places' is not an integer, it is truncated.
 
*If 'places' is not an integer, it is truncated.
  
*Calci returns an #ERROR message if 'places' are nonnumeric
+
*If 'places' are nonnumeric, Calci returns an #ERROR message.
  
 
*If 'places' is negative, Calci ignores the places and displays the octal output.
 
*If 'places' is negative, Calci ignores the places and displays the octal output.
 +
 +
For Example,
  
 
BIN2OCT(1100100) ''returns 144''
 
BIN2OCT(1100100) ''returns 144''
 +
 +
BIN2OCT(100100100,4) ''returns 0444''
 +
 +
BIN2OCT("00111",1.3) ''returns 07''
  
 
== Examples ==
 
== Examples ==

Revision as of 12:33, 16 November 2013

BIN2OCT(number,places)

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

BIN2OCT converts a binary number to its octal equivalent.

Description

BIN2OCT(number,places)

  • 'number' must be a binary number. Binary number is represented using digits 1 or 0 only. The number can also be entered in text format (e.g "101").
  • The most significant bit represents the 'sign' of the number (0=positive, 1=negative). Negative numbers are represented using 2's complement notation.
  • A number preceding with '0' (e.g 01111111111) should be written in text format ("01111111111") to avoid confusion with octal numbers.
  • Calci returns an #ERROR message if 'number' contains more than 10 characters (10 bits).

Need to verify the 'limit for no. of input digits' after next release

  • If 'number' is negative, Calci ignores the places, if any and displays 10 digit octal output.
  • If 'places' is not an integer, it is truncated.
  • If 'places' are nonnumeric, Calci returns an #ERROR message.
  • If 'places' is negative, Calci ignores the places and displays the octal output.

For Example,

BIN2OCT(1100100) returns 144

BIN2OCT(100100100,4) returns 0444

BIN2OCT("00111",1.3) returns 07

Examples

Formula Octal Output
BIN2OCT(100) 4
BIN2OCT(110011,4)
BIN2OCT(11001100,6)
BIN2OCT(11110000)

See Also

References