"Sputnik" help |

Sputnik
Help

Description

Counts the number of bits that are set to 0 in the given value.Parameters

<value> | The value for which the number of zero bits is to be counted. It can be an integer or a floating-point value. |

Return Value

Success: | Returns an integer representing the count of zero bits in the given value. |

Failure: | Returns null. |

Remarks

The function performs the popcount operation by counting the set bits in the binary representation of the value. When a double value is provided, its bits are reinterpreted as an integer to accurately count the set bits. This ensures consistent behavior across different data types.

Please note that the PopCount function may have different performance characteristics depending on the underlying implementation and the size of the input value.

Related

PopCountExample

Example of usage:

my$value=0b11001101;say PopCount($value);say PopCountZero($value);// PRINTS// 5// 3

Contact

Cheryl (uberfox@hotmail.com)

Homepage

http://ubersoft.org