Function pecsim::sign(double, double)

Function Documentation

double pecsim::sign(double a, double b)

Returns the value of a with a sign of b. If b is positive, returns the absolute value of a. If b is negative, returns the negative absolute value of a.

Parameters:
  • a – the value to return

  • b – the sign to apply

Returns:

double the value of a with the sign of b