$Binary: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (Mlarocca moved page $BINARY to $Binary: Lower case change)
No edit summary
 
Line 1: Line 1:
<p>The $BINARY function converts the character string representation of a number into its equivalent fixed-point binary representation. </p>
<p>The $Binary function converts the character string representation of a number into its equivalent fixed-point binary representation. </p>
<b>Syntax</b>
<b>Syntax</b>
<p>The format of the $BINARY function is:</p>
<p>The format of the $Binary function is:</p>
<p class="code">$BINARY (string <var>[</var>, precision <var>[</var>, scale<var>]]</var>)
<p class="code">$Binary (string <var>[</var>, precision <var>[</var>, scale<var>]]</var>)
</p>
</p>
<p>where:</p>
<p>where:</p>
Line 13: Line 13:
</li>
</li>
</ul>
</ul>
<p>$BINARY returns a value of binary -1 if the string argument does not represent a valid number, if an invalid precision or scale value is specified, or if an overflow occurs.  </p>
<p>$Binary returns a value of binary -1 if the string argument does not represent a valid number, if an invalid precision or scale value is specified, or if an overflow occurs.  </p>
[[Category:SOUL $functions]]
[[Category:SOUL $functions]]

Latest revision as of 13:17, 8 July 2014

The $Binary function converts the character string representation of a number into its equivalent fixed-point binary representation.

Syntax

The format of the $Binary function is:

$Binary (string [, precision [, scale]])

where:

  • string is the character string to be converted.
  • precision (optional) indicates the number of binary digits (bits) desired in the result of the function. Precision must be between 1 and 31, although the most meaningful values are 15 and 31. If the precision argument is greater than 15, a default value of 31 is used. If the precision argument is omitted, a default value of 15 (halfword) is used.
  • scale (optional) indicates the number of fractional binary digits assumed in the result of the function. If the scale argument is omitted, a default value of 0 (integer) is used.

$Binary returns a value of binary -1 if the string argument does not represent a valid number, if an invalid precision or scale value is specified, or if an overflow occurs.