(extension version)
Signed Math Library 0.2.
(interface (signed $Y))
(interface (signed $ $Y))
(interface (signed $Z))
(interface (signed $Z))
(interface (signed $Z))
(interface (signed $Z))
(signed [$XS $XN] is signed)
(number $XN)
($XS is one of [+ -])
(signed cast $X into [+ $X])
(number $X)
(signed [+ $X] is positive)
(number $X)
~($X = 0)
(signed $X is positive)
(signed cast $X into $CX)
(signed $CX is positive)
(signed [- $X] is negative)
(number $X)
~($X = 0)
(signed $X is negative)
(signed cast $X into $CX)
(signed $CX is negative)
(signed 0 is zero)
(signed [+ 0] is zero)
(signed [- 0] is zero)
(signed $X = $X)
(signed $X = $Y)
(signed $X is zero)
(signed $Y is zero)
(signed [+ $X] is non-negative)
(number $X)
(signed $X is non-negative)
(signed cast $X into $CX)
(signed $CX is non-negative)
(signed [- $X] is non-positive)
(number $X)
(signed $X is non-positive)
(signed cast $X into $CX)
(signed $CX is non-positive)
(signed $X > $Y)
(if) (signed $X is positive) (then)
(if) (signed $Y is positive) (then)
($X = [+ $PX])
($Y = [+ $PY])
($PX > $PY)
(elseif) (signed $Y is non-positive) (then)
(fail)
(else)
WARNING: \( signed $X > $Y \) :
$Y is not a signed or unsigned number.
(endif)
(elseif) (signed $X is non-positive) (then)
(if) (signed $Y is non-positive) (then)
($X = [- $NX])
($Y = [- $NY])
($NX < $NY)
(elseif) (signed $Y is positive) (then)
%% succeed
(else)
WARNING: \( signed $X > $Y \) :
$Y is not a signed or unsigned number.
(endif)
(else)
WARNING: \( signed $X > $Y \) :
$X is not a signed or unsigned number.
(endif)
(signed $X > $Y)
(signed cast $X into $CX)
(signed cast $Y into $CY)
(signed $CX > $CY)
(signed $X > $Y)
(signed cast $X into $CX)
(signed $CX > $Y)
(signed $X > $Y)
(signed cast $Y into $CY)
(signed $X > $CY)
(signed $X < $Y)
(if) (signed $X is positive) (then)
(if) (signed $Y is positive) (then)
($X = [+ $PX])
($Y = [+ $PY])
($PX < $PY)
(elseif) (signed $Y is non-positive) (then)
%% succeed
(else)
WARNING: \( signed $X > $Y \) :
$Y is not a signed or unsigned number.
(endif)
(elseif) (signed $X is non-positive) (then)
(if) (signed $Y is non-positive) (then)
($X = [- $NX])
($Y = [- $NY])
($NX > $NY)
(elseif) (signed $Y is positive) (then)
(fail)
(else)
WARNING: \( signed $X > $Y \) :
$Y is not a signed or unsigned number.
(endif)
(else)
WARNING: \( signed $X > $Y \) :
$X is not a signed or unsigned number.
(endif)
(signed $X < $Y)
(signed cast $X into $CX)
(signed cast $Y into $CY)
(signed $CX < $CY)
(signed $X < $Y)
(signed cast $X into $CX)
(signed $CX < $Y)
(signed $X < $Y)
(signed cast $Y into $CY)
(signed $X < $CY)
(signed negate [+ $X] into [- $X])
(signed negate [- $X] into [+ $X])
(signed negate $X into $Y)
(signed cast $X into $CX)
(signed negate $CX into $Y)
(signed $X plus $Y into $Z)
(if) (signed $X is non-negative) (then)
($X = [+ $PX])
(if) (signed $Y is non-negative) (then)
($Y = [+ $PY])
($PX plus $PY into $PZ)
($Z = [+ $PZ])
(elseif) (signed $Y is negative) (then)
($Y = [- $NY])
(if) ($PX > $NY) (then)
($PX minus $NY into $PZ)
($Z = [+ $PZ])
(else)
($NY minus $PX into $NZ)
($Z = [- $NZ])
(endif)
(else)
WARNING: \( signed $X plus $Y into $Z \) :
$Y is not a signed or unsigned number.
(endif)
(elseif) (signed $X is negative) (then)
($X = [- $NX])
(if) (signed $Y is non-negative) (then)
($Y = [+ $NY])
(if) ($NX > $PY) (then)
($NX minus $PY into $NZ)
($Z = [- $NZ])
(else)
($PY minus $NX into $PZ)
($Z = [+ $PZ])
(endif)
(elseif) (signed $Y is negative) (then)
($Y = [- $NY])
($NX plus $NY into $NZ)
($Z = [- $NZ])
(else)
WARNING: \( signed $X plus $Y into $Z \) :
$Y is not a signed or unsigned number.
(endif)
(else)
WARNING: \( signed $X plus $Y into $Z \) :
$X is not a signed or unsigned number.
(endif)
(signed $X plus $Y into $Z)
(signed cast $X into $CX)
(signed cast $Y into $CY)
(signed $CX plus $CY into $Z)
(signed $X plus $Y into $Z)
(signed cast $X into $CX)
(signed $CX plus $Y into $Z)
(signed $X plus $Y into $Z)
(signed cast $Y into $CY)
(signed $X plus $CY into $Z)
(signed $X minus $Y into $Z)
(signed negate $Y into $NY)
(signed $X plus $NY into $Z)
(signed $X minus $Y into $Z)
(signed cast $X into $CX)
(signed cast $Y into $CY)
(signed $CX minus $CY into $Z)
(signed $X minus $Y into $Z)
(signed cast $X into $CX)
(signed $CX minus $Y into $Z)
(signed $X minus $Y into $Z)
(signed cast $Y into $CY)
(signed $X minus $CY into $Z)
(signed [$SX $NX] times [$SY $NY] into [$SZ $NZ])
($NX times $NY into $NZ)
(if) ($SX = $SY) (then)
($SZ = @+)
(else)
($SZ = @-)
(endif)
(signed $X times $Y into $Z)
(signed cast $X into $CX)
(signed cast $Y into $CY)
(signed $CX times $CY into $Z)
(signed $X times $Y into $Z)
(signed cast $X into $CX)
(signed $CX times $Y into $Z)
(signed $X times $Y into $Z)
(signed cast $Y into $CY)
(signed $X times $CY into $Z)
(signed [$SX $NX] divided by [$SY $NY] into [$SZ $NZ])
($NX divided by $NY into $NZ)
(if) ($SX = $SY) (then)
($SZ = @+)
(else)
($SZ = @-)
(endif)
(signed $X divided by $Y into $Z)
(signed cast $X into $CX)
(signed cast $Y into $CY)
(signed $CX divided by $CY into $Z)
(signed $X divided by $Y into $Z)
(signed cast $X into $CX)
(signed $CX divided by $Y into $Z)
(signed $X divided by $Y into $Z)
(signed cast $Y into $CY)
(signed $X divided by $CY into $Z)