---
title: "squareRoot"
canonical: "https://help.vicon.com/space/ShogunPost121/1253737106/squareRoot"
format: markdown
---
# Description

Returns the square root of a number. If the number is negative, the command will fail.

## Functional area

Math

# Command syntax

## Syntax

> Macro (scroll-tablelayout)

|  |
| --- |
| `squareRoot number` |

### Arguments

| Name | Type | Required | Comments |
| --- | --- | --- | --- |
| `number` | float | yes | Either a float or an int whose square root is to be returned. Cannot be negative. |

### Flags

None

## Return value

float

Returns the square root of a positive number

> Macro (scroll-pagebreak)

## Examples

```plaintext
// Compute some square roots
float $root, $value = 1000; 
$root = `squareRoot 9`;
print $root;
 
// Should be 3.000000
$root = `squareRoot $value`;
print $root; 
// Should be 31.622776
```

# Additional information

## Related commands

- [abs](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253738387)
- [fabs](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737000)