SGN()
SailerMan
Posts: 337
What is the best way to simulate the command SGN(Value) from other BASIC dialects. It equals 1 if Value is Positive, -1 if Value is Negative and 0 if Value is 0.
Comments
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.iElectronicDesigns.com
·
Is that command something that can be added to a future release of the SX/B compiler? That is a useful BASIC command and would help.
Robert
We could, but I would expect SGN to return either "0", "1" or "-1". So it would only work when assigned to BYTE or WORD variables.
BTW: ABS is already added.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.iElectronicDesigns.com
·
Robert