Sqrt

From Eternity Wiki
Revision as of 02:05, 10 May 2026 by Printz (talk | contribs) (Created page with "{{ACSFunction|description=Returns the square root of a number. |usage= ''int'' '''Sqrt'''(''int number'') ''fixed'' '''FixedSqrt'''(''fixed number'') |parameters= *''number'': operand, which can be integer or fixed point, depending on function. |return=The square root. |notes=Be careful that '''Sqrt''' only operates and returns integers, and the result is rounded ''down''. For a negative operand, it will return 0 and beep an error. If you need decimal precision, use...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Description[edit]

This is an ACS built-in function.

Returns the square root of a number.

Usage[edit]

int Sqrt(int number)

fixed FixedSqrt(fixed number)

Parameters[edit]

  • number: operand, which can be integer or fixed point, depending on function.

Return value[edit]

The square root.

Examples[edit]

No examples given.

Notes[edit]

Be careful that Sqrt only operates and returns integers, and the result is rounded down. For a negative operand, it will return 0 and beep an error. If you need decimal precision, use FixedSqrt.

This function's identification in zspecial.acs is: -48 for Sqrt, -49 for FixedSqrt.

See also[edit]