MoreMathSqr Method

Computes x2.

Definition

Namespace: Meta.Numerics
Assembly: Meta.Numerics (in Meta.Numerics.dll) Version: 4.2.0+6d77d64445f7d5d91b12e331399c4362ecb25333
C#
public static double Sqr(
	double x
)

Parameters

x  Double
The argument.

Return Value

Double
The square of the argument.

Remarks

There is nothing numerically sophisticated inside this function; it exists simply for programmers' convenience. Given a complicated expression that needs to be squared, it is nice to be able to wrap it in a simple call to this function instead of explicitly assigning its value to a new variable and then, in a separate statement, multiplying that variable by itself. Even if you are hyper-vigilant about function call overhead, you should not worry about using this function, because even the most basic optimizing compiler will optimize away the call.

See Also