Topic complex |
Array functions |
Function |
bitsum() |
Short |
Gibt die Summe übereinstimmender Bitwerte aus mehreren Arrays |
Syntax |
BitSum(VAR result : INTEGER[]; VAR B1, B2, B3 ... : TBITS[]) |
Parameter |
result : Ziel-Feld in Form eines INTEGER-Arrays
B1..Bn : nahezu beliebige Anzahl an TBit-Arrays (max. 32) |
Return |
|
See also: |
|
Description |
Die Funktion berechnet das INTEGER-Feld result nach folgender Regel
result[i]:=B1[i]+B2[i]+B3[i]...
|
Example 1: BitNot + BitTrunc
VAR x : TBITS[]
InitArray(x[3])
BitSum(x) // = 0 <> bits 000[00000]
BitNot(x)
BitSum(x) // = 8 <> bits 111[11111]
BitTrunc(x,3 +1)
BitSum(x) // = 3 <> bits 111[00000]
|
Write a comment:
|