What's wrong with sq() function?

I’ve problem with sq() function.
I get correct result if sq(<=181) , but if the number is >181 the result is in totally wrong
(and negative ( - ##### ) on top of it all) number.
Is this something normal? Or is this happening to me only?
Any idea how to fix it?

Please post a complete program that shows the problem

It happens only for you. Post a small piece of code that illustrates this for you. One that we can compile and try.

Don’t try to store it in a signed int :wink: If you use a unsigned int you’re good up to 255 and with a unsigned long up to 65535.

I suspect you're using int for your experiments. A signed int can only hold up to 32767 and 182 is where you exceed it. Try using long.