11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

$FACTOR• $ZEXP function• $ZLN function$FACTORConverts integer to bitstring.$FACTOR(num,scale)ParametersnumscaleAn expression that evaluates to an integer. Fractional numbers are roundedto an integer.Optional — An integer used as a power-of-ten exponent (scientific notation)multiplier for num. The default is 0.Description$FACTOR returns the binary bitstring that corresponds to the supplied integer. If you specifya decimal number as num, $FACTOR rounds this number to an integer, and then returns thebinary bitstring that corresponds to this integer. When rounding numbers, <strong>Caché</strong> rounds thefraction .5 up to the next highest integer.The binary string returned specifies bit positions starting from position 1 (left-to-right). Thiscorresponds to the bitstrings used by the various $BIT functions.ParametersnumA number (or an expression that evaluates to a number). $FACTOR applies the scaleparameter (if supplied), converts this number to an integer by rounding, and then returns thecorresponding bitstring. num can be positive or negative. If num is zero, or rounds to zero,or is the null string (""), $FACTOR returns a null string.scaleAn integer that specifies the scientific notation exponent to apply to num. For example, ifscale is 2, then scale represents 10 exponent 2, or 100. This scale value is multiplied by num.For example, $FACTOR(7,2) returns the bitstring that corresponds to the integer 700. Thismultiplication is done before rounding num to an integer. By default, scale is 0.<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 209

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!