Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

bitGet()

Purpose

Get the value of a bit in a binary number

Description

Find out if the value of the specified bit in a binary number is 0 or 1

Syntax

result = bitGet( number, bit )

Arguments

number Number value

bit Bit to get the value of (0-31). Bit 31 is the sign bit.

result Resulting bit value (0 or 1)

Example

number = random( 100000 ) + 1
bit0 = bitGet( number, 0 )
if bit0 > 0 then
    print( number, " is an odd number" )
else
    print( number, " is an even number" )
endIf
update()
sleep( 3 )

Associated Commands

bitCount(), bitSet(), bitFieldExtract(), bitFieldInsert(), leadingZeroes(), trailingZeroes()

logo

©2019 FUZE Technologies Ltd. FUZE is a registered trademark of FUZE Technologies Ltd. All rights reserved.

Useful links

  • Fuze Main Site
  • Fuze Arena on Twitter
  • Fuze Arena on Youtube
  • Download Buyer

Contact Information

  • FUZE Technologies Ltd
    15 Clearfields Farm
    Wotton Underwood
    Aylesbury, Buckinghamshire
    ​England, HP18 0RS

  • +44 (0) 1844 239 432

  • contact@fuze.co.uk

© Copyright FUZE Technologies Ltd. All rights reserved.