Hi everyone,

Is there a way to check if a number is a perfect square ? I’ve got this but it isn’t working for large numbers,

```
if TheNumber < 0 then return false
return (TheNumber ^ 0.5 as integer) ^ 2 = TheNumber
```

The problem is that larger numbers can’t be written as integers in AppleScript.

Richard
#2
How about

varnumber^.5 as integer = varnumber^.5

That made me thinking. Yours still uses the as integer part which can’t handler the big numbers but if I round the number down it will work.

```
(round (TheNumber ^ 0.5) rounding down) = TheNumber ^ 0.5
```

Thanks

Or:

```
(theNumber ^ 0.5) mod 1 = 0.0
```

Oh, I didn’t think of that one. Thank you !