Square root function sqrt() in script

How to correctly include and run the square root function in scripts?

I try
import math
print math.sqrt(4)

but obtain
AttributeError: ‘com.inductiveautomation.ignition.designer.gui.tool’ object has no attribute ‘sqrt’

Ignition 8.0.15

Where are you trying to run the script?

Works for me in Script Console 8.0.14

I am trying in script console too

I’d try deleting your cache, and letting it download a fresh copy from the gateway.

Without result(
A project colleague on a different machine has the same problem

Ok, seems pow() is working, so I will use it
Strange problem with such popular function…
Thanks to all

Do you have a project script named math?

1 Like

Oh really it exists
Now it is clear.
Thank you!