# List of available Math.js functions

**URL:** <https://community.homey.app/t/list-of-available-math-js-functions/18665>\
**Category:** Questions & Help\
**Created:** [September 29, 2019, 8:12pm UTC](https://community.homey.app/t/list-of-available-math-js-functions/18665 "2019-09-29T20:12:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Le\_Cactus](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/le_cactus/32/9727_2.png) [@Le\_Cactus](https://community.homey.app/u/Le_Cactus)\
**Post date:** [September 29, 2019, 8:12pm UTC](https://community.homey.app/t/list-of-available-math-js-functions/18665/1 "2019-09-29T20:12:57Z")

</div>

Is there a list of math functions _that do work_? Not all functions listed on [https://mathjs.org/docs/reference/functions.html](https://mathjs.org/docs/reference/functions.html) work. Functions like “{{mean(2, 1, 4, 3)}}” and “{{round(5.345,2)}}” work flawlessly, but but XOR (like {{ xor(8, 2) }}), OR and AND do not seem to work. Or am I missing something?

I’m looking for a way to do some bitwise operations in flows.

Any help is greatly apprecieated.

---

<div class="post-metadata">

**Author:** ![Le\_Cactus](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/le_cactus/32/9727_2.png) [@Le\_Cactus](https://community.homey.app/u/Le_Cactus)\
**Post date:** [September 29, 2019, 10:03pm UTC](https://community.homey.app/t/list-of-available-math-js-functions/18665/2 "2019-09-29T22:03:51Z")

</div>

Hmmm, bitwise operations can be down with the “|”, “&” and “^ signs.” So calculating a variable goes like this:

8th bit =\> On: OR 10000000 / Off: AND 01111111 =\> On {{Warmtevraag |128}} / Off {{Warmtevraag |127}}  
7th bit =\> On: OR 01000000 / Off: AND 10111111 =\> On {{Warmtevraag |64}} / Off {{Warmtevraag |191}}  
6th bit =\> On: OR 00100000 / Off: AND 11011111 =\> On {{Warmtevraag |32}} / Off {{Warmtevraag |223}}  
5th bit =\> On: OR 00010000 / Off: AND 11101111 =\> On {{Warmtevraag |16}} / Off {{Warmtevraag |239}}  
4th bit =\> On: OR 00001000 / Off: AND 11110111 =\> On {{Warmtevraag |8}} / Off {{Warmtevraag |247}}  
3rd bit =\> On: OR 00000100 / Off: AND 11111011 =\> On {{Warmtevraag |4}} / Off {{Warmtevraag |251}}  
2nd bit =\> On: OR 00000010 / Off: AND 11111101 =\> On {{Warmtevraag |2}} / Off {{Warmtevraag |253}}  
1st bit =\> On: OR 00000001 / Off: AND 11111110 =\> On {{Warmtevraag |1}} / Off {{Warmtevraag |254}}

Still don’t understand why {{Warmtevraag or 1}} and {{Warmtevraag and 254}} don’t work, so still would like to know which math functions are supported. For future reference 🙂

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [September 30, 2019, 4:45am UTC](https://community.homey.app/t/list-of-available-math-js-functions/18665/3 "2019-09-30T04:45:01Z")

</div>

Duplicate topic [here](https://community.homey.app/t/available-math-functions/16622).

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [September 30, 2019, 6:28am UTC](https://community.homey.app/t/list-of-available-math-js-functions/18665/4 "2019-09-30T06:28:02Z")

</div>

> [@Le\_Cactus](#):
>
> Still don’t understand why {{Warmtevraag or 1}} and {{Warmtevraag and 254}} don’t work

According to [the fine manual](https://mathjs.org/docs/expressions/syntax.html), `and` and `or` are logical operators, not bitwise operators.

---

<div class="post-metadata">

**Author:** ![Le\_Cactus](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/le_cactus/32/9727_2.png) [@Le\_Cactus](https://community.homey.app/u/Le_Cactus)\
**Post date:** [September 30, 2019, 6:36am UTC](https://community.homey.app/t/list-of-available-math-js-functions/18665/5 "2019-09-30T06:36:08Z")

</div>

> [@robertklep](#):
>
> > [@Le\_Cactus](#):
> >
> > Still don’t understand why {{Warmtevraag or 1}} and {{Warmtevraag and 254}} don’t work
> 
> According to [the fine manual](https://mathjs.org/docs/expressions/syntax.html), `and` and `or` are logical operators, not bitwise operators.

Thanks, that was the list I was looking for.
