ObjectScript Reference
$BITCOUNT


$BITCOUNT(bitstring,bitvalue)
An expression that evaluates to a bitstring. Can be a variable of any type, 

SET $BIT(a,1) = 0 SET $BIT(a,2) = 0 SET $BIT(a,3) = 1 SET $BIT(a,4) = 1 SET $BIT(a,5) = 0 WRITE !,$BITCOUNT(a)
SET $BIT(a,1) = 0 SET $BIT(a,2) = 0 SET $BIT(a,3) = 1 SET $BIT(a,4) = 1 SET $BIT(a,5) = 0 WRITE !,"number of zero bits:",$BITCOUNT(a,0) WRITE !,"number of one bits: ",$BITCOUNT(a,1)
SET x=$RANDOM(65536) FOR i=1:1:16 {WRITE $BIT($FACTOR(x),i) } WRITE !,"Number of 1 bits=",$BITCOUNT($FACTOR(x),1)
Content for this page loaded from RCOS_fbitcount.xml on 20180201 14:30:12
