SquareRoot OptoScript?

So I am looking to get the SquareRoot of 5.9 and I am using
fRoot = SquareRoot(5.9);
The issue I am seeing is that it returns a value of 2 and not 2.4. In the HelpCommands it specifies you can pass in float and have a float returned. This does not appear to be working as documented?

I just did your test here.

Seems to be working as expected for me, so now we need to find out what the difference is between your command and mine.

In debug, inspect the variable, click the expand icon, then click on More Info.
What do you see there?

So it looks like for some reason the float is being read as an Int

Yup, looks like it is an Int32. It clearly says ‘I32’ in the strategy tree.
Once created and in use, you can not change the type, only the name… so…

You will need to slightly rename Int32 in the strategy tree.
Then create a new one, being sure to select float from the drop down type list.
Then rename your Optoscript from the slightly different name to the new name and thus move it from the Int32 over to the new float.

Ah now I feel silly, been looking at it to long and could not see the trees through the forest. Thanks

Or you can got To Configure | Options and check this option and not have to do the whole renaming thing which is useful when your variable is in a lot of places in Optoscript blocks:

image