# Power function in Code block

**URL:** <https://forum.dynamobim.com/t/power-function-in-code-block/642>\
**Category:** Packages\
**Created:** [October 16, 2014, 5:10am UTC](https://forum.dynamobim.com/t/power-function-in-code-block/642 "2014-10-16T05:10:38Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/5/c550ed42453f927febfd2bb94d4388fbcf36b9a6.png) [@system](https://forum.dynamobim.com/u/system)\
**Post date:** [October 16, 2014, 5:10am UTC](https://forum.dynamobim.com/t/power-function-in-code-block/642/1 "2014-10-16T05:10:38Z")

</div>

[Formula in Code Block](http://dynamobim.org/wp-content/uploads/forum-assets/scdaitscdaarchitects-com/10/16/Formula-in-Code-Block.dyn)

Dear all,

How to use the power function in code block? Kindly see attached.

Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/5/c550ed42453f927febfd2bb94d4388fbcf36b9a6.png) [@system](https://forum.dynamobim.com/u/system)\
**Post date:** [October 16, 2014, 5:18am UTC](https://forum.dynamobim.com/t/power-function-in-code-block/642/2 "2014-10-16T05:18:08Z")

</div>

![Power function in Code block](http://dynamobim.org/wp-content/uploads/forum-assets/scdaitscdaarchitects-com/10/16/Power-function-in-Code-block.png) ![Power function in Code block](http://dynamobim.org/wp-content/uploads/forum-assets/scdaitscdaarchitects-com/10/16/Power-function-in-Code-block-300x156.jpg)

---

<div class="post-metadata">

**Author:** ![jostein\_olsen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jostein_olsen/32/8570_2.png) [@jostein\_olsen](https://forum.dynamobim.com/u/jostein_olsen)\
**Post date:** [October 16, 2014, 5:31am UTC](https://forum.dynamobim.com/t/power-function-in-code-block/642/3 "2014-10-16T05:31:09Z")

</div>

Hey Chander,

try typing Math.Pow(x,y)

x being the number and y being the power.

---

<div class="post-metadata">

**Author:** ![Ritesh\_Chandawar](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@Ritesh\_Chandawar](https://forum.dynamobim.com/u/Ritesh_Chandawar)\
**Post date:** [October 16, 2014, 9:03am UTC](https://forum.dynamobim.com/t/power-function-in-code-block/642/4 "2014-10-16T09:03:50Z")

</div>

Hello [Chander Gupta](http://dynamobim.org/forums/users/scdaitscdaarchitects-com/ "View Chander Gupta's profile"),

All Math operations in Dynamo need to be used by writing Math. and method which you want to use.

Thanks,

Ritesh

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/5/c550ed42453f927febfd2bb94d4388fbcf36b9a6.png) [@system](https://forum.dynamobim.com/u/system)\
**Post date:** [October 16, 2014, 9:05pm UTC](https://forum.dynamobim.com/t/power-function-in-code-block/642/5 "2014-10-16T21:05:13Z")

</div>

Hi guys,

Thanks for your reply.

Math.Pow(x,y) works perfectly…

Chander.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/5/c550ed42453f927febfd2bb94d4388fbcf36b9a6.png) [@system](https://forum.dynamobim.com/u/system)\
**Post date:** [October 16, 2014, 9:18pm UTC](https://forum.dynamobim.com/t/power-function-in-code-block/642/6 "2014-10-16T21:18:54Z")

</div>

It works just nicely…

Thanks Again

![Power function in Code block](http://dynamobim.org/wp-content/uploads/forum-assets/scdaitscdaarchitects-com/10/17/Power-function-in-Code-block-300x288.jpg)

---

<div class="post-metadata">

**Author:** ![Ritesh\_Chandawar](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@Ritesh\_Chandawar](https://forum.dynamobim.com/u/Ritesh_Chandawar)\
**Post date:** [October 16, 2014, 10:17pm UTC](https://forum.dynamobim.com/t/power-function-in-code-block/642/7 "2014-10-16T22:17:30Z")

</div>

Hello [Chander Gupta](http://dynamobim.org/forums/users/scdaitscdaarchitects-com/ "View Chander Gupta's profile"),

One suggestion, in your graph you have written X and Y in separate CBN and then connected to formula written in CBN.

Actually you dont have to create X and Y, you can directly pass output of Range expression (1…10…1 and 1…20…2) to your CBN where you have written Formula.

Keep using Dynamo, if stuck we are here to help you. 🙂

Thanks,

Ritesh

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/5/c550ed42453f927febfd2bb94d4388fbcf36b9a6.png) [@system](https://forum.dynamobim.com/u/system)\
**Post date:** [October 16, 2014, 11:24pm UTC](https://forum.dynamobim.com/t/power-function-in-code-block/642/8 "2014-10-16T23:24:00Z")

</div>

Oh yes…

x & y CBN is redundent.

Thanks.

&nbsp;

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/5/c550ed42453f927febfd2bb94d4388fbcf36b9a6.png) [@system](https://forum.dynamobim.com/u/system)\
**Post date:** [October 16, 2014, 11:39pm UTC](https://forum.dynamobim.com/t/power-function-in-code-block/642/9 "2014-10-16T23:39:25Z")

</div>

![Multiple Functions in Code Block](http://dynamobim.org/wp-content/uploads/forum-assets/scdaitscdaarchitects-com/10/17/Multiple-Functions-in-Code-Block-300x210.jpg)Interesting !!

---

<div class="post-metadata">

**Author:** ![samuel\_barcenas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/samuel_barcenas/32/27329_2.png) [@samuel\_barcenas](https://forum.dynamobim.com/u/samuel_barcenas)\
**Post date:** [June 11, 2015, 10:35am UTC](https://forum.dynamobim.com/t/power-function-in-code-block/642/10 "2015-06-11T10:35:25Z")

</div>

hi chander

Im was looking at your last image in this topic

Im working with points trough a spline and i trying to figure out how can i manage to control the distance between the points similar to what you got, in my case i want to change the Z axis,

Any ideas, Thanks man

&nbsp;

&nbsp;

![Points](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/6/6a3261b74b14ba53a88b1f7fab3fee8b8ed5a949.jpg)
