@nataliapc/mcp-openmsx
Version:
Model context protocol server for openMSX automation and control
39 lines (23 loc) • 551 B
Markdown
# SGN()
## Effect
Returns the sign (positive of negative) of a variable.
## Syntax
`SGN (<Expression>)`
## Parameter
`<Expression>` can be a value, a numeric variable or an mathematical expression.
## Example
```basic
10 PRINT "The sign of -7 is ";SGN(-7)
20 PRINT "The sign of 0 is ";SGN(0)
30 PRINT "The sign of 7 is ";SGN(7)
RUN
The sign of -7 is -1
The sign of 0 is 0
The sign of 7 is 1
```
## Related to
`ABS()`, `FIX()`, `INT()`
## Compatibility
MSX-BASIC 1.0 or higher
## Source
Retrieved from "https://www.msx.org/wiki/SGN()"