Rate This Document
Findability
Accuracy
Completeness
Readability

atand

Compute the degree corresponding to the arctangent of the input real number.

Interface Definition

C interface:

float atandf(float x);

double atand(double x);

Parameters

Parameter

Type

Description

Input/Output

x

  • For atandf, x is of single-precision floating-point type.
  • For atand, x is of double-precision floating-point type.

Floating-point value of the input data.

Input

Return Value

  • Normal range: The degree y corresponding to the arctangent of the input x is returned, that is, y = atan(x) * 180/π. y ∈ [-90, +90]
  • Special values: See the following table.

    Input Value (x)

    Output Value (y)

    +0

    +0

    -0

    -0

    +inf

    90

    -inf

    -90

    NaN

    NaN

Dependency

C: "km.h"

Example

C interface:
// typical usage
float x1 = -1.0, x2 = 1.0, x3 = 0.5, x4 = -0.5;
// special handling
float a = 0.0, b = INFINITY, c = -INFINITY, d = NAN;
// print result
printf("atand(1.0) = %.15f\n", atand(x1));
printf("atand(-1.0) = %.15f\n", atand(x2));
printf("atand(0.5) = %.15f\n", atand(x3));
printf("atand(-0.5) = %.15f\n", atand(x4));
printf("atand(0.0) = %.15f\n", atand(a));
printf("atand(-0.0) = %.15f\n", atand(-a));
printf("atand(INFINITY) = %.15f\n", atand(b));
printf("atand(-INFINITY) = %.15f\n", atand(c));
printf("atand(NAN) = %.15f\n", atand(d));
/*
 *  atand(1.0) = -45.000000000000000
 *  atand(-1.0) = 45.000000000000000
 *  atand(0.5) = 26.565051177077990
 *  atand(-0.5) = -26.565051177077990
 *  atand(0.0) = 0.000000000000000
 *  atand(-0.0) = -0.000000000000000
 *  atand(INFINITY) = 90.000000000000000
 *  atand(-INFINITY) = -90.000000000000000
 *  atand(NAN) = nan
 *
 * */