# Using 10^() in Logics calculation and Homeyscript results in different values

**URL:** <https://community.homey.app/t/using-10-in-logics-calculation-and-homeyscript-results-in-different-values/91235>\
**Category:** Questions & Help\
**Tags:** homeyscript, homey-pro\
**Created:** [October 8, 2023, 1:13am UTC](https://community.homey.app/t/using-10-in-logics-calculation-and-homeyscript-results-in-different-values/91235 "2023-10-08T01:13:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [October 8, 2023, 1:13am UTC](https://community.homey.app/t/using-10-in-logics-calculation-and-homeyscript-results-in-different-values/91235/1 "2023-10-08T01:13:58Z")

</div>

Continuing the discussion from

> [@Ein Flow zum überprüfen der qualität der verwendeten Daten](https://community.homey.app/t/ein-flow-zum-uberprufen-der-qualitat-der-verwendeten-daten/91219/2):
>
> Ich habe das mit einer Berechnung der Luftfeuchtigkeit gemacht auf Basis von relativer Feuchtigkeit + Temperatur innen und außen. Mit den Sensordaten (Aqara-Sensor) kann man so die reale Feuchtigkeit ermitteln und vergleichen. Es bringt ja nix, nur die relative Luftfeuchtigkeit zu vergleichen, weil die temperaturabhängig ist. D.h. es macht keinen Sinn zu lüften, wenn außen 50% bei 10° sind und innen 60% bei 23°. Ich muss nochmal den Post suchen. Ich ergänze das dann nochmal. Edit: Hier der Li…

Hi all,

I am playing with the formula for absolute humidity, but I wanted to use an [Adv. Virtual Device](https://community.homey.app/t/app-pro-advanced-virtual-device-device-capabilities-app-with-unique-text-status-indicator/68198) instead of a [Virtual Device](https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723);  
However, the outcome of the formula is then different than with a standard flow chart (Logik or a VD).  
The AVD and Homeyscript return the same value, but it is not within 0-100 (the value range for humidity)

When I replace `10^` with `10*`, they all do return the same result, which is `13.154246753335052`,  
`10^` is apparently interpreted differently?

How do I now get the same result as with a Logic ‘calculate’ chart?

Formula:

```auto
let absHum = 100000 * 18.016/8314.3 * 85 / 100 * 6.1078 * 10^((7.5 * 11 )/(237.3 + 11 ))/( 11 + 273.15);
return absHum;

```

![Screenshot from 2023-10-08 00-58-03](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/e/1ee3f35973194567c5bf8a4eca4441c2f093d799.png)

---

<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:** [October 8, 2023, 5:56am UTC](https://community.homey.app/t/using-10-in-logics-calculation-and-homeyscript-results-in-different-values/91235/2 "2023-10-08T05:56:01Z")

</div>

Use `**` instead of `^`.

[MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Exponentiation).

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [October 8, 2023, 3:47pm UTC](https://community.homey.app/t/using-10-in-logics-calculation-and-homeyscript-results-in-different-values/91235/3 "2023-10-08T15:47:27Z")

</div>

Thanks Robert!  
That solved it ✅ 🥳

```auto
let absHum = 100000 * 18.016/8314.3 * 85 / 100 * 6.1078 * 10 ** ((7.5 * 11 )/(237.3 + 11 ))/( 11 + 273.15);
return absHum;

```
