user
Signum: Sign of an integer - represent the sign of an integer using a value from a set of 3 or 4 integers.

Task

Create a function that takes a signed integer *x*, and returns another signed integer as follows:

* if *x*<0, return -1,
* if *x*>0, return 1 (positive 1),
* if *x*=0, return 0.

If the integer representation used supports a signed zero, then the function should preserve the sign of the zero. That is,

* if *x*=-0, return -0,
* if *x*=+0, return +0.

Example

:   :   | input | output |
        | --- | --- |
        | -10 | -1 |
        | 42 | 1 |
        | 0 | 0 |

Additional example for integer types with a signed zero (uncommon)

:   :   | input | output |
        | --- | --- |
        | -0 | -0 |
assistant
Raku has IEEE 754 floating point numbers as part of it's numeric spectrum, so understands -0 as a concept, but does not make any attempt to keep negative zeros. Once a number is interpreted numerically, it is automatically "narrowed" to it's most compact form for display.

```
say +($_ <=> 0), ": $_" for 1, -5, 2⁷⁶, -7⁴⁴, π, Inf, -Inf, 0, -0;

```

Output:

```
1: 1
-1: -5
1: 75557863725914323419136
-1: -15286700631942576193765185769276826401
1: 3.141592653589793
1: Inf
-1: -Inf
0: 0
0: 0

```