# Bitwise Operators?

**URL:** https://community.thunkable.com/t/bitwise-operators/326560
**Category:** Questions about Thunkable X
**Created:** [November 18, 2019, 9:13pm UTC](https://community.thunkable.com/t/bitwise-operators/326560 "2019-11-18T21:13:16Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![b.perkins](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/b.perkins/32/50493_2.png) [@b.perkins](https://community.thunkable.com/u/b.perkins)
#### Post date: [November 18, 2019, 9:13pm UTC](https://community.thunkable.com/t/bitwise-operators/326560/1 "2019-11-18T21:13:16Z")

</div>

Hola Thunkadors,

I searched for “bitwise” in the X forum, but found nothing so I hope someone can help me. I did find a related post, but it is clearly not for X.

> [@Bitwise And operation Algorithm](http://community.thunkable.com/t/bitwise-and-operation-algorithm/6893):
>
> Please find a bitwise And operation Algorithm. Following the algorithm you can also create Or, Xor, operations. In the category Extensions, you can also find my first extension, Bitwise Extension, which has already all the bitwise operations.

I’d like to do bitwise operations between two numbers. For those who don’t know about bitwise operators, you can read about them [here](https://en.wikipedia.org/wiki/Bitwise_operation).

Of course, I tried the boolean operator blocks, but they wouldn’t accept numbers as parameters. Any other suggestions?

Thanks in advance!

---

<div class="post-metadata">

### Author: ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)
#### Post date: [November 19, 2019, 6:54am UTC](https://community.thunkable.com/t/bitwise-operators/326560/2 "2019-11-19T06:54:50Z")

</div>

Hi,

Blocks of logical operations understand numbers. To do this, use variables.

Thunkable X has partial support for working with numbers in hexadecimal and binary form. You can see more details on the page [http://droidscript.ru/main/statyi/thunkablex\_base4.php](http://droidscript.ru/main/statyi/thunkablex_base4.php) when studying the type of number. To work with hexadecimal numbers, you can also use blocks for working with color.

---

<div class="post-metadata">

### Author: ![b.perkins](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/b.perkins/32/50493_2.png) [@b.perkins](https://community.thunkable.com/u/b.perkins)
#### Post date: [November 19, 2019, 12:14pm UTC](https://community.thunkable.com/t/bitwise-operators/326560/3 "2019-11-19T12:14:50Z")

</div>

Hi AC,

Thanks for that and there is some useful information there, but I still cannot do a bitwise and with 2 numbers. Using the boolean AND, if the first number is non-zero the result is the contents of the second operand. E.g…

x = 1, y = 1: x AND y = 1 (correct)  
x = 63, y = 1: x AND y = 1 (correct)  
x = 1, y = 63: x AND y = 63 (incorrect)

Thanks in advance for any other suggestions!

---

<div class="post-metadata">

### Author: ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)
#### Post date: [November 19, 2019, 1:17pm UTC](https://community.thunkable.com/t/bitwise-operators/326560/4 "2019-11-19T13:17:46Z")

</div>

You cannot do bitwise operations using logical operations. Here you have to think hard - translate numbers into binary format, and then use the blocks to work with texts to select the desired bit and perform a logical operation with it

---

<div class="post-metadata">

### Author: ![b.perkins](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/b.perkins/32/50493_2.png) [@b.perkins](https://community.thunkable.com/u/b.perkins)
#### Post date: [November 19, 2019, 2:22pm UTC](https://community.thunkable.com/t/bitwise-operators/326560/5 "2019-11-19T14:22:14Z")

</div>

> [@actech](#):
>
> Here you have to think hard

Haha, that’s not a problem. I’ve been doing binary/octal/hexadecimal since 1977. I just don’t see the point since every modern programming/scripting language can do bitwise operations.

It is such a basic building block for so many other things that I am having difficulty believing it was not included in Thunkable at the same time as the basic arithmetic operators. Hopefully it will soon be available.

Thank you!

---

<div class="post-metadata">

### Author: ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)
#### Post date: [November 19, 2019, 8:10pm UTC](https://community.thunkable.com/t/bitwise-operators/326560/6 "2019-11-19T20:10:02Z")

</div>

Unfortunately, when working with Thunkable X, you’ll have to create many things manually, even if that doesn’t make sense. ) If you know how to program, then it will be interesting for you to work with Thunkable X and come up with functionality that is not in it.

---

<div class="post-metadata">

### Author: ![b.perkins](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/b.perkins/32/50493_2.png) [@b.perkins](https://community.thunkable.com/u/b.perkins)
#### Post date: [November 20, 2019, 6:39am UTC](https://community.thunkable.com/t/bitwise-operators/326560/7 "2019-11-20T06:39:41Z")

</div>

But I don’t have time to create functionality which is not portable. I would do it if it could be copy/pasted or otherwise imported into another project. Also, if the project were open source, I’d be happy to work on the code to create new additional functions.

---

<div class="post-metadata">

### Author: ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)
#### Post date: [November 20, 2019, 6:49am UTC](https://community.thunkable.com/t/bitwise-operators/326560/8 "2019-11-20T06:49:14Z")

</div>

I’m afraid to disappoint you in that Thunkable X is no possibility of any work with the code or copy blocks between projects, or to get basic functionality in terms of which provide programming languages.

---

<div class="post-metadata">

### Author: ![b.perkins](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/b.perkins/32/50493_2.png) [@b.perkins](https://community.thunkable.com/u/b.perkins)
#### Post date: [November 20, 2019, 6:50am UTC](https://community.thunkable.com/t/bitwise-operators/326560/9 "2019-11-20T06:50:37Z")

</div>

Yet 😁

---

<div class="post-metadata">

### Author: ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)
#### Post date: [November 20, 2019, 9:48am UTC](https://community.thunkable.com/t/bitwise-operators/326560/10 "2019-11-20T09:48:36Z")

</div>

> [@b.perkins](#):
>
> Yet

Exactly Brian! We’ve been working hard on adding this sort of functionality for a while now and it will dramatically improve your workflow once released.

But, as @actech suggests, you shouldn’t let that stop you from trying out things now either! 😀

> [@actech](#):
>
> it will be interesting for you to work with Thunkable X and come up with functionality that is not in it.

---

<div class="post-metadata">

### Author: ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)
#### Post date: [November 8, 2024, 11:43am UTC](https://community.thunkable.com/t/bitwise-operators/326560/11 "2024-11-08T11:43:00Z")

</div>


