square

Returns the square of the input.

Syntax


floatExpr square(floatExpr x)
intExpr square(intExpr x)

Parameters

  • x: integer or floating-point expression.

Description

Function square computes the square of x. Depending on the type of x the result is an integer or a floating-point expression.

Example


a = intVar(-10..10);
square(a) == 4;

The problem above has two solutions: a=-2 and a=2.