dos_copysign - dalefugier/DOSLib GitHub Wiki
Returns a number with the sign of another number.
Syntax
(dos_copysign first second)
Parameters
first
The number whose sign is to be adjusted.
second
The number whose sign is to be used.
Returns
first
with its sign changed to match the sign of second
, if successful.
nil on error.
Example
Command: (dos_copysign 3.14 -1)
-3.14
Command: (dos_copysign -3.14 -1)
-3.14
Command: (dos_copysign -3.14 1)
3.14