neg (value -- negatedValue)negatedValue: Negated value in the same schema.neg accepts signed Int schemas and Real schemas. The input is dereferenced and must be non-NIL.
This is arithmetic negation, not bitwise complement. The Whole or Real value is mapped to its additive inverse.
Bitwise complement is provided by ~.
{} () {} [
"-- int32 --" printCompilerMessage
7 neg printStack _:;
-7 neg printStack _:;
"-- neg versus ~ --" printCompilerMessage
5 neg printStack _:;
5 ~ printStack _:;
"-- real32 --" printCompilerMessage
2.5r32 neg printStack _:;
-2.5r32 neg printStack _:;
"-- unknown real32 --" printCompilerMessage
value: 0.0r32 dynamic;
value neg printStack _:;
] "main" exportFunction
-- int32 --
-7
7
-- neg versus ~ --
-5
-6
-- real32 --
-2.5r32
2.5r32
-- unknown real32 --
Real32
^ builtin (base exponent -- power) Raises one Real value to another of the same schema and keeps that real schema in the result.cast builtin (value schema -- convertedValue) Casts a Cond or numeric value to the numeric schema selected by the schema input.ceil builtin (value -- ceilingValue) Rounds a Real value upward and keeps the same real schema.cos builtin (angle -- cosine) Computes the cosine of a Real value and keeps the same real schema.floor builtin (value -- floorValue) Rounds a Real value downward and keeps the same real schema.log builtin (argument -- naturalLogarithm) Computes the natural logarithm of a Real value and keeps the same real schema.log10 builtin (argument -- decimalLogarithm) Computes the base-10 logarithm of a Real value and keeps the same real schema.sin builtin (angle -- sine) Computes the sine of a Real value and keeps the same real schema.sqrt builtin (radicand -- squareRoot) Computes the square root of a Real value and keeps the same real schema.