Skip to content

TrailingZeros

Narta Xaymar Dirks edited this page Oct 28, 2026 · 6 revisions
BlitzLLVM

TrailingZeros 〔BlitzLLVM〕

TrailingZeros:Int32 value:Int32
Parameter Mode Type Default Description
value In Int32 required An integer.

Returns: How many of the lowest bits are 0.

Description

〔BlitzLLVM〕 This command does not exist in the original Blitz products. BlitzLLVM adds it.

Counts the bits that are 0 after the last 1, from the lowest bit up. A number of 0 has all of its bits counted. This is a BlitzLLVM extension. It looks at the bits of the number the way its type has them, so the same value counts differently as a Byte, an Int or a Long: a number written in the program is an Int (32 bits) unless it is larger, and Byte, UByte, Short, UShort, UInt, Long and ULong give the other widths. A real or a text is taken as an Int, like the bit operators do.

Differences

  • Not in the originals.

Examples

Print TrailingZeros(8)
Print TrailingZeros(Short(0))
Print TrailingZeros(ULong(1) Shl 40)
3
16
40

Related Commands

LeadingZeros 〔BlitzLLVM〕, Sqr, Tan

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally