Whatever message this page gives is out now! Go check it out!

BitMaskClear

Last update:
May 18, 2026

Description

Performs a bitwise mask clear operation.

Returns

A number, bitwise cleared, with length bits beginning at start.

Category

Function syntax

BitMaskClear(number, start, length)

See also

Parameters

Parameter
Description
number
32-bit signed integer
start
Integer, in the range 0-31, inclusive; start bit for mask
length
Integer, in the range 0-31, inclusive; length of mask

Usage

Bit functions operate on 32-bit signed integers, in the range -2147483648 - 2147483647.

Example

<h3>BitMaskClear Example</h3> 
 
 <p>Returns number bitwise cleared with length bits beginning from start.</p> 
 
 <p>BitMaskClear(255, 4, 4): <cfoutput>#BitMaskClear(255, 4, 4)#</cfoutput></p> 
 <p>BitMaskClear(255, 0, 4): <cfoutput>#BitMaskClear(255, 0, 4)#</cfoutput></p> 
 <p>BitMaskClear(128, 0, 7): <cfoutput>#BitMaskClear(128, 0, 7)#</cfoutput></p>

Example

<cfscript>
  number = 255 ;
  number1 = 0 ;
  length =4 ;
  writeOutput(bitmaskclear(number, number1, length)) ; //Return 240
</cfscript>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page