Difference between revisions of "Manuals/calci/DEC2OCT"

From ZCubes Wiki
Jump to navigation Jump to search
 
(8 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
*Where 'number' is the decimal number to be converted, and
 
*Where 'number' is the decimal number to be converted, and
  
*'places' is the number of characters.  
+
*'places' is the number of characters to display the output.  
  
 
DEC2OCT() is used to convert decimal number to its octal equivalent.
 
DEC2OCT() is used to convert decimal number to its octal equivalent.
Line 11: Line 11:
 
DEC2OCT(number, places)
 
DEC2OCT(number, places)
  
 +
*The 'number' can be in-between -536870912 and 536870911, else Calci displays a #NUM! error.
 +
*Output is a 30 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 (30 bit) octal number.
 +
*'places' argument can be omitted. Then, Calci displays the octal output with minimum number of characters necessary.
 +
*'places' is used for padding the output with leading '0's'.
 +
*A number preceding with '0' (e.g. 0377) should be written in text format ("0377") to avoid confusion with octal numbers.
  
If omitted then it use minimum number of characters.NumberPlace is use for adding to return value with leading zeros.
+
For Example,
  
</div>
+
DEC2OCT(68,3) ''returns 104''
----
 
<div id="1SpaceContent" class="zcontent" align="left">
 
  
Calci converts a decimal number to octal.
+
DEC2OCT(99) ''returns 0000000143''
  
</div>
+
DEC2OCT(99.45) ''returns 0000000143''
----
 
<div id="7SpaceContent" class="zcontent" align="left">
 
  
If SomeNumber and NumberPlaces are non-numeric, DEC2BIN returns the#ERROR.
+
*Calci displays an error message, if the 'number' is an invalid decimal number.
 +
*If the 'number' is not an integer, Calci considers the integer part, and displays the output.
 +
*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.
  
If the NumberPlaces is a negative, it returns the #ERROR.
+
== Examples ==
  
If NumberPlaces &gt; LengthofSomeNumber then  returns #ERROR.
 
 
</div>
 
----
 
<div id="12SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="left">
 
 
DEC2OCT
 
 
<font size="6"></font>
 
 
</div></div>
 
----
 
<div id="8SpaceContent" class="zcontent" align="left">
 
 
Lets see an example in (Column1, Row1)
 
 
<nowiki>=DEC2OCT(68,3)</nowiki>
 
 
DEC2OCT converts 68 to 104 upto 3 charcacters.
 
 
</div>
 
----
 
<div id="10SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Syntax </div><div class="ZEditBox"><center></center></div></div>
 
----
 
<div id="4SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Remarks </div></div>
 
----
 
<div id="3SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Examples </div></div>
 
----
 
<div id="11SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Description </div></div>
 
----
 
 
<div id="2SpaceContent" class="zcontent" align="left">
 
<div id="2SpaceContent" class="zcontent" align="left">
  
 
{| id="TABLE3" class="SpreadSheet blue"
 
{| id="TABLE3" class="SpreadSheet blue"
 
|- class="even"
 
|- class="even"
| class=" " |
+
| class=" " | '''Function'''
| Column1
+
| class="  " | '''Octal Output'''
| Column2
+
 
| Column3
 
| Column4
 
 
|- class="odd"
 
|- class="odd"
| class=" " | Row1
+
| class="sshl_f" | DEC2OCT(512)
| class="sshl_f" | 104
+
| class="sshl_f" | 0000001000
|
+
 
|
 
|
 
 
|- class="even"
 
|- class="even"
| class=" " | Row2
+
| class="sshl_f" | DEC2OCT(512,3)
| class="                 SelectTD ChangeBGColor SelectTD" |
+
| class="sshl_f" | 1000
<div id="2Space_Handle" class="zhandles" title="Click and Drag to resize CALCI Column/Row/Cell. It is EZ!"></div><div id="2Space_Copy" class="zhandles" title="Click and Drag over to AutoFill other cells."></div><div id="2Space_Drag" class="zhandles" title="Click and Drag to Move/Copy Area.">[[Image:copy-cube.gif]]  </div>
+
 
|
 
|
 
|
 
 
|- class="odd"
 
|- class="odd"
| Row3
+
| class="sshl_f" | DEC2OCT(2378,-4)
| class="sshl_f   " |
+
| class="sshl_f" | 4512
|
+
 
|
 
|
 
 
|- class="even"
 
|- class="even"
| Row4
+
| class="sshl_f" | DEC2OCT(7878.78)
|
+
| class="sshl_f" | 0000017306
|
+
 
|
 
|
 
 
|- class="odd"
 
|- class="odd"
| class=" " | Row5
+
| class="sshl_f" | DEC2OCT("-364")
|
+
| class="sshl_f" | 7777777224
|
 
|
 
|
 
|- class="even"
 
| Row6
 
|
 
|
 
|
 
|
 
 
|}
 
|}
  
<div align="left">[[Image:calci1.gif]]</div></div>
+
==Related Videos==
----
+
 
 +
{{#ev:youtube|tYW7RpOX3_I|280|center|DEC2OCT}}
 +
 
 +
== See Also ==
 +
 
 +
*[[Manuals/calci/DEC2BIN| DEC2BIN]]
 +
 
 +
*[[Manuals/calci/DEC2HEX| DEC2HEX]]
 +
 
 +
*[[Manuals/calci/OCT2DEC| OCT2DEC]]
 +
 
 +
==References==
 +
 
 +
*[http://en.wikipedia.org/wiki/Octal Octal Numbers]

Latest revision as of 14:22, 17 April 2015

DEC2OCT(number, places)

  • Where 'number' is the decimal number to be converted, and
  • 'places' is the number of characters to display the output.

DEC2OCT() is used to convert decimal number to its octal equivalent.

Description

DEC2OCT(number, places)

  • The 'number' can be in-between -536870912 and 536870911, else Calci displays a #NUM! error.
  • Output is a 30 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 (30 bit) octal number.
  • 'places' argument can be omitted. Then, Calci displays the octal output with minimum number of characters necessary.
  • 'places' is used for padding the output with leading '0's'.
  • A number preceding with '0' (e.g. 0377) should be written in text format ("0377") to avoid confusion with octal numbers.

For Example,

DEC2OCT(68,3) returns 104

DEC2OCT(99) returns 0000000143

DEC2OCT(99.45) returns 0000000143

  • Calci displays an error message, if the 'number' is an invalid decimal number.
  • If the 'number' is not an integer, Calci considers the integer part, and displays the output.
  • 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.

Examples

Function Octal Output
DEC2OCT(512) 0000001000
DEC2OCT(512,3) 1000
DEC2OCT(2378,-4) 4512
DEC2OCT(7878.78) 0000017306
DEC2OCT("-364") 7777777224

Related Videos

DEC2OCT

See Also

References