Difference between revisions of "Manuals/calci/OCT2DEC"

 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
=OCT2DEC(number, places)=
 
=OCT2DEC(number, places)=
  
<font color="red">places argument to be included in upcoming version</font>
+
*Where <math>number</math> is the octal number to be converted to decimal number.
  
*Where 'number' is the octal number to be converted to decimal number.
+
*<math>places</math> is the number of characters to display the output.  
  
 
OCT2DEC() converts an octal number to a decimal number.
 
OCT2DEC() converts an octal number to a decimal number.
Line 9: Line 9:
 
== Description ==
 
== Description ==
  
OCT2DEC(number)
+
OCT2DEC(number, places)
  
For example,  
+
*For example,  
  
OCT2DEC("100") ''returns 64'' as a result.
+
*OCT2DEC("100") ''returns 64'' as a result.
  
OCT2DEC("") ''returns '' as a result.  
+
*OCT2DEC("500",4) ''returns '0320' as a result.  
  
 
*This function is used to convert an octal number to a decimal number.
 
*This function is used to convert an octal number to a decimal number.
*The 'number' should be in the range '7777777000' for negative numbers (DEC -512) to '777' for positive numbers (DEC 511).
+
*The <math>number</math> should be in the range '7777777000' for negative numbers (DEC -512) to '777' for positive numbers (DEC 511).
 
*A number can be up to 10 characters (40 bits). The most significant bit is the sign bit and remaining are magnitude bits. A negative number is represented in 2's complement format.
 
*A number can be up to 10 characters (40 bits). The most significant bit is the sign bit and remaining are magnitude bits. A negative number is represented in 2's complement format.
*If the number is not a valid number, 'Calci' returns an #ERROR message.
+
*If the <math>number</math> is not a valid number, 'Calci' returns an #N/A error message.
*A number preceding with '0' (e.g 013) should be written in text format ("013") to avoid confusion with hexadecimal numbers.   
+
*A number preceding with '0' (e.g 013) should be written in text format ("013") to avoid confusion with hexadecimal numbers.  
 +
*If <math>number</math> is not an integer, Calci truncates the value to calculate the output.
 +
*<math>places</math> argument is used to return the output with leading zeros. If <math>places</math> argument is not used, 'Calci' uses the minimum number of characters required to display the output.
 +
*If <math>places</math> is not an integer, Calci rounds the value and uses the integer part as input.
 +
*If <math>places</math> is less than the number of output characters, Calci ignores the places and uses the minimum number of characters required to display the output.
 +
    
 
Below are few examples that show the use of combination of functions and get the result in decimal -
 
Below are few examples that show the use of combination of functions and get the result in decimal -
  
1)SUM(OCT2DEC("") + OCT2DEC("")) ''returns '' as a result.  
+
1)SUM(OCT2DEC("65"), OCT2DEC("11")) ''returns 62'' as a result.  
  
2)OCT2DEC("") - OCT2DEC("") ''returns '' as a result.
+
2)OCT2DEC("654") - OCT2DEC("54") ''returns 384'' as a result.
  
 
== Examples ==
 
== Examples ==
Line 38: Line 43:
  
 
|- class="odd"
 
|- class="odd"
| class="sshl_f" |  
+
| class="sshl_f" | OCT2DEC("15")
| class="sshl_f" |  
+
| class="sshl_f" | 13
  
 
|- class="even"
 
|- class="even"
| class="ssh1_f" |  
+
| class="ssh1_f" | OCT2DEC("40.44")
| class="sshl_f" |  
+
| class="sshl_f" | #NUM!
 
 
 
|- class="odd"
 
|- class="odd"
| class="ssh1_f" |
+
| class="ssh1_f" | OCT2DEC("55",4)
| class="sshl_f" |
+
| class="sshl_f" | 0045
 
 
|- class="even"
 
| class="ssh1_f"
 
| class="sshl_f" |  
 
 
|}
 
|}
  
== See Also ==
+
==Related Videos==
  
*[[Manuals/calci/DEC2HEX| DEC2HEX]]
+
{{#ev:youtube|QIkfAkcfy0w|280|center|OCT2DEC}}
  
*[[Manuals/calci/HEX2BIN| HEX2BIN]]
+
== See Also ==
  
*[[Manuals/calci/HEX2OCT| HEX2OCT]]
+
*[[Manuals/calci/DEC2OCT| DEC2OCT]]
  
*[[Manuals/calci/BIN2HEX| BIN2HEX]]
+
*[[Manuals/calci/OCT2BIN| OCT2BIN]]
  
 
*[[Manuals/calci/OCT2HEX| OCT2HEX]]
 
*[[Manuals/calci/OCT2HEX| OCT2HEX]]
  
 
==References==
 
==References==
 +
 
*[http://simple.wikipedia.org/wiki/Octal_numeral_system#Octal_and_decimal Octal to Decimal Conversion]
 
*[http://simple.wikipedia.org/wiki/Octal_numeral_system#Octal_and_decimal Octal to Decimal Conversion]

Latest revision as of 10:49, 13 May 2015

OCT2DEC(number, places)

  • Where   is the octal number to be converted to decimal number.
  •   is the number of characters to display the output.

OCT2DEC() converts an octal number to a decimal number.

Description

OCT2DEC(number, places)

  • For example,
  • OCT2DEC("100") returns 64 as a result.
  • OCT2DEC("500",4) returns '0320' as a result.
  • This function is used to convert an octal number to a decimal number.
  • The   should be in the range '7777777000' for negative numbers (DEC -512) to '777' for positive numbers (DEC 511).
  • A number can be up to 10 characters (40 bits). The most significant bit is the sign bit and remaining are magnitude bits. A negative number is represented in 2's complement format.
  • If the   is not a valid number, 'Calci' returns an #N/A error message.
  • A number preceding with '0' (e.g 013) should be written in text format ("013") to avoid confusion with hexadecimal numbers.
  • If   is not an integer, Calci truncates the value to calculate the output.
  •   argument is used to return the output with leading zeros. If   argument is not used, 'Calci' uses the minimum number of characters required to display the output.
  • If   is not an integer, Calci rounds the value and uses the integer part as input.
  • If   is less than the number of output characters, Calci ignores the places and uses the minimum number of characters required to display the output.

Below are few examples that show the use of combination of functions and get the result in decimal -

1)SUM(OCT2DEC("65"), OCT2DEC("11")) returns 62 as a result.

2)OCT2DEC("654") - OCT2DEC("54") returns 384 as a result.

Examples

Octal Input Decimal Output
OCT2DEC("15") 13
OCT2DEC("40.44") #NUM!
OCT2DEC("55",4) 0045

Related Videos

OCT2DEC

See Also

References