math.h Flashcards

1
Q

What is pow()?

Declaration:

double pow(double x, double y);

A

Returns x raised to the power of y.

Range:

x cannot be negative if y is a fractional value. x cannot be zero if y is less than or equal to zero.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is tanh()?

Declaration:

double tanh(double x);

A

Returns the hyperbolic tangent of x.

Range:

The value of x has no range. The returned value is in the range of -1 to +1 (inclusive).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is log10()?

Declaration:

double log10(double x);

A

Returns the common logarithm (base-10 logarithm) of x.

Range:

There is no range limit on the argument or return value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is atan2()?

Declaration:

double atan2(doubly y, double x);

A

Returns the arc tangent in radians of y/x based on the signs of both values to determine the correct quadrant.

Range:

Both y and x cannot be zero. The returned value is in the range of -p/2 to +p/2 (inclusive).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is modf()?

Declaration:

double modf(double x, double *integer);

A

Breaks the floating-point number x into integer and fraction components.
The returned value is the fraction component (part after the decimal), and sets integer to the integer component.

Range:

There is no range limit on the argument or return value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is asin()?

Declaration:

double asin(double x);

A

Returns the arc sine of x in radians.

Range:

The value of x must be within the range of -1 to +1 (inclusive). The returned value is in the range of -p/2 to +p/2 (inclusive).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is ldexp()?

Declaration:

double ldexp(double x, int exponent);

A

Returns x multiplied by 2 raised to the power of exponent.
x*2^exponent

Range:

There is no range limit on the argument or return value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is atan()?

Declaration:

double atan(double x);

A

Returns the arc tangent of x in radians.

Range:

The value of x has no range. The returned value is in the range of -p/2 to +p/2 (inclusive).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is sqrt()?

Declaration:

double sqrt(double x);

A

Returns the square root of x.

Range:

The argument cannot be negative. The returned value is always positive.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is cosh()?

Declaration:

double cosh(double x);

A

Returns the hyperbolic cosine of x.

Range:

There is no range limit on the argument or return value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is frexp()?

Declaration:

double frexp(double x, int *exponent);

A

The floating-point number x is broken up into a mantissa and exponent.
The returned value is the mantissa and the integer pointed to by exponent is the exponent. The resultant value is x=mantissa * 2^exponent.

Range:

The mantissa is in the range of .5 (inclusive) to 1 (exclusive).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is acos()?

Declaration:

double acos(double x);

A

Returns the arc cosine of x in radians.

Range:

The value x must be within the range of -1 to +1 (inclusive). The returned value is in the range of 0 to pi (inclusive).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is sinh()?

Declaration:

double sinh(double x);

A

Returns the hyperbolic sine of x.

Range:

There is no range limit on the argument or return value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is fmod()?

Declaration:

double fmod(double x, double y);

A

Returns the remainder of x divided by y.

Range:

There is no range limit on the return value. If y is zero, then either a range error will occur or the function will return zero (implementation-defined).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is cos()?

Declaration:

double cos(double x);

A

Returns the cosine of a radian angle x.

Range:

The value of x has no range. The returned value is in the range of -1 to +1 (inclusive).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is exp()?

Declaration:

double exp(double x);

A

Returns the value of e raised to the xth power.

Range:

There is no range limit on the argument or return value.

17
Q

What is fabs()?

Declaration:

double fabs(double x);

A

Returns the absolute value of x (a negative value becomes positive, positive value is unchanged).

Range:

There is no range limit on the argument. The return value is always positive.

18
Q

What is floor()?

Declaration:

double floor(double x);

A

Returns the largest integer value less than or equal to x.

Range:

There is no range limit on the argument or return value.

19
Q

What is HUGE_VAL?

A

A constant.

A function returns this value when the result of a mathematical operation yields a value that is so large in magnitude that it is not representable with its return type. This is one of the possible range errors, and is signaled by setting errno to ERANGE.

Actually, functions can either return a positive or a negative HUGE_VAL (HUGE_VAL or -HUGE_VAL) to at least indicate the sign of the result.

20
Q

What is log()?

Declaration:

double log(double x);

A

Returns the natural logarithm (base-e logarithm) of x.

Range:

There is no range limit on the argument or return value.

21
Q

What is sin()?

Declaration:

double sin(double x);

A

Returns the sine of a radian angle x.

Range:

The value of x has no range. The returned value is in the range of -1 to +1 (inclusive).

22
Q

What is tan()?

Declaration:

double tan(double x);

A

Returns the tangent of a radian angle x.

Range:

There is no range limit on the argument or return value.

23
Q

What is ceil()?

Declaration:

double ceil(double x);

A

Returns the smallest integer value greater than or equal to x.

Range:

There is no range limit on the argument or return value.