Click or drag to resize

MoreMathSqr Method

Computes x2.

Namespace:  Meta.Numerics
Assembly:  Meta.Numerics (in Meta.Numerics.dll) Version: 4.1.4
Syntax
public static double Sqr(
	double x
)

Parameters

x
Type: SystemDouble
The argument.

Return Value

Type: 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