Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

bitSet()

Purpose

Set or clear a bit in a binary number

Description

Set (1) or clear (0) the specfied bit in a 32 bit signed binary number

Syntax

result = bitSet( number, bit, value )

Arguments

number Initial number value

bit Bit to set or clear (0-31). Bit 31 is the sign bit.

value 1 (set) or 0 (clear)

result Resulting number value

Example

number = 0
for i = 0 to 16 loop
    number = bitSet( number, i, 1 )
    printAt( 0, i , number )
    update()
repeat
sleep( 3 )

Associated Commands

bitCount(), bitGet(), bitFieldExtract(), bitFieldInsert()

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.