# How to import module Math to function node?

**URL:** <https://discourse.nodered.org/t/how-to-import-module-math-to-function-node/78660>\
**Category:** General\
**Tags:** function-node\
**Created:** [24 May 2023 14:18 UTC](https://discourse.nodered.org/t/how-to-import-module-math-to-function-node/78660 "2023-05-24T14:18:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![beg1nner](https://avatars.discourse-cdn.com/v4/letter/b/d26b3c/32.png) [@beg1nner](https://discourse.nodered.org/u/beg1nner)\
**Post date:** [24 May 2023 14:18 UTC](https://discourse.nodered.org/t/how-to-import-module-math-to-function-node/78660/1 "2023-05-24T14:18:05Z")

</div>

Hi there.

I want to take the second root of some variable in the node-red function node.  
So I imported "Math" in the setting-tab.  
but before I even could sart the srcipt this was my output-error:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/d/bd0686610729b77a6233f0b10ece3416053b34dc.png)

This is my code:

```auto
const input = msg.payload;
msg.payload = Math.sqrt(input);
return msg;

```

And this is what I've done in the settings:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/1/61867d3a525bace0cffb5275aecaa524a6463707.png)

What to do now?  
Thanks for help.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [24 May 2023 14:19 UTC](https://discourse.nodered.org/t/how-to-import-module-math-to-function-node/78660/2 "2023-05-24T14:19:33Z")

</div>

`Math` is a built-in. You do not need to import it or add it to the external modules tab - you can just use it.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [7 June 2023 14:19 UTC](https://discourse.nodered.org/t/how-to-import-module-math-to-function-node/78660/3 "2023-06-07T14:19:53Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
