# Sgn

Determine the sign of a number

## Method Signature

```
Sgn(number=[numeric])
```

### Arguments

| Argument | Type      | Required | Description                          | Default |
| -------- | --------- | -------- | ------------------------------------ | ------- |
| `number` | `numeric` | `true`   | The number to determine the sign of. |         |

## Examples

### Sign of any number greater than 0

[Run Example](https://try.boxlang.io/?code=eJwrTs%2FTUNAzVtC05gIAEo4CgA%3D%3D)

```java
sgn( .3 );

```

Result: 1

### Sign of 0

[Run Example](https://try.boxlang.io/?code=eJwrTs%2FTUDBQ0LTmAgAP2gJP)

```java
sgn( 0 );

```

Result: 0

### Sign of any number less than 0

[Run Example](https://try.boxlang.io/?code=eJwrTs%2FTUNDVM1bQtOYCABVaAq0%3D)

```java
sgn( -.3 );

```

Result: -1

### Additional Examples

```java
15 = <bx:output>#sgn( 15 )#</bx:output><br>
-15 = <bx:output>#sgn( -15 )#</bx:output>
```

## Related

* [Abs](/boxlang-language/reference/built-in-functions/math/abs.md)
* [Acos](/boxlang-language/reference/built-in-functions/math/acos.md)
* [Asin](/boxlang-language/reference/built-in-functions/math/asin.md)
* [Atn](/boxlang-language/reference/built-in-functions/math/atn.md)
* [Ceiling](/boxlang-language/reference/built-in-functions/math/ceiling.md)
* [Cos](/boxlang-language/reference/built-in-functions/math/cos.md)
* [DecrementValue](/boxlang-language/reference/built-in-functions/math/decrementvalue.md)
* [Exp](/boxlang-language/reference/built-in-functions/math/exp.md)
* [Fix](/boxlang-language/reference/built-in-functions/math/fix.md)
* [Floor](/boxlang-language/reference/built-in-functions/math/floor.md)
* [FormatBaseN](/boxlang-language/reference/built-in-functions/math/formatbasen.md)
* [IncrementValue](/boxlang-language/reference/built-in-functions/math/incrementvalue.md)
* [InputBaseN](/boxlang-language/reference/built-in-functions/math/inputbasen.md)
* [Int](/boxlang-language/reference/built-in-functions/math/int.md)
* [Log](/boxlang-language/reference/built-in-functions/math/log.md)
* [Log10](/boxlang-language/reference/built-in-functions/math/log10.md)
* [Max](/boxlang-language/reference/built-in-functions/math/max.md)
* [Min](/boxlang-language/reference/built-in-functions/math/min.md)
* [Pi](/boxlang-language/reference/built-in-functions/math/pi.md)
* [PrecisionEvaluate](/boxlang-language/reference/built-in-functions/math/precisionevaluate.md)
* [Rand](/boxlang-language/reference/built-in-functions/math/rand.md)
* [Randomize](/boxlang-language/reference/built-in-functions/math/randomize.md)
* [RandRange](/boxlang-language/reference/built-in-functions/math/randrange.md)
* [Round](/boxlang-language/reference/built-in-functions/math/round.md)
* [Sin](/boxlang-language/reference/built-in-functions/math/sin.md)
* [Sqr](/boxlang-language/reference/built-in-functions/math/sqr.md)
* [Tan](/boxlang-language/reference/built-in-functions/math/tan.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/sgn.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
