How do I check if a particular bit is set on an integer value within a PowerApp? There doesn't seem to be a built-in operator or function for bit manipulation.
As I do need this for quite few operations, using an external / Custom Connector is probably too expensive for me.
Mod(Trunc(Number / (2 ^ Bit)), 2) = 1
This expression will be true
if Bit
flag (counting from zero) for the value Number
is set. Otherwise false
.
Eg:
Number
= 32 Bit
= 5 : true
Number
= 32 Bit
= 4 : false
If you are going to use it often in your app, you might want to register it as a custom function for easier use
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.