## Name:

~ floating-point evaluation of a constant expression

## Usage:

~ expression : function -> constant ~ something : any type -> any type

## Parameters:

• expression stands for an expression that is a constant
• something stands for some language element that is not a constant expression

## Description:

• ~ expression evaluates the expression that is a constant term to a floating-point constant. The evaluation may involve a rounding. If expression is not a constant, the evaluated constant is a faithful rounding of expression with precision bits, unless the expression is exactly 0 as a result of cancellation. In the latter case, a floating-point approximation of some (unknown) accuracy is returned.
• ~ does not do anything on all language elements that are not a constant expression. In other words, it behaves like the identity function on any type that is not a constant expression. It can hence be used in any place where one wants to be sure that expressions are simplified using floating-point computations to constants of a known precision, regardless of the type of actual language elements.
• ~ error evaluates to error and provokes a warning.
• ~ is a prefix operator not requiring parentheses. Its precedence is the same as for the unary + and - operators. It cannot be repeatedly used without brackets.

## Example 1:

> print(exp(5));
exp(5)
> print(~ exp(5));
1.48413159102576603421115580040552279623487667593878e2

## Example 2:

> autosimplify = off!;

## Example 3:

> print(~sin(5 * pi));
0

## Example 4:

> print(~exp(x));
exp(x)
> print(~ "Hello");
Hello

## Example 5:

> print(~exp(x*5*Pi));
exp((pi) * 5 * x)
> print(exp(x* ~(5*Pi)));
exp(x * 1.57079632679489661923132169163975144209858469968757e1)

## Example 6:

> print(~exp(5)*x);
1.48413159102576603421115580040552279623487667593878e2 * x
> print( (~exp(5))*x);
1.48413159102576603421115580040552279623487667593878e2 * x
> print(~(exp(5)*x));
exp(5) * x