Oihana PHP Arango

bitPopcount.php

Table of Contents

Functions

bitPopcount()  : string
Return the number of bits set to 1 in a number (population count).

Functions

bitPopcount()

Return the number of bits set to 1 in a number (population count).

bitPopcount(string|int $value) : string

Wraps the ArangoDB AQL function BIT_POPCOUNT(value).

Example AQL usage:

BIT_POPCOUNT(255)   // returns 8
BIT_POPCOUNT(69)    // returns 3
Parameters
$value : string|int

The number whose set bits are counted.

Tags
example
use function oihana\arango\db\functions\bit\bitPopcount;

$expr = bitPopcount(255);   // 'BIT_POPCOUNT(255)'
see
https://docs.arangodb.com/stable/aql/functions/bit/#bit_popcount
since
1.1.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results