1tan(3)                     Library Functions Manual                     tan(3)
2
3
4

NAME

6       tan, tanf, tanl - tangent function
7

LIBRARY

9       Math library (libm, -lm)
10

SYNOPSIS

12       #include <math.h>
13
14       double tan(double x);
15       float tanf(float x);
16       long double tanl(long double x);
17
18   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
19
20       tanf(), tanl():
21           _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
22               || /* Since glibc 2.19: */ _DEFAULT_SOURCE
23               || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
24

DESCRIPTION

26       These functions return the tangent of x, where x is given in radians.
27

RETURN VALUE

29       On success, these functions return the tangent of x.
30
31       If x is a NaN, a NaN is returned.
32
33       If  x is positive infinity or negative infinity, a domain error occurs,
34       and a NaN is returned.
35
36       If the correct result would overflow, a range  error  occurs,  and  the
37       functions  return HUGE_VAL, HUGE_VALF, or HUGE_VALL, respectively, with
38       the mathematically correct sign.
39

ERRORS

41       See math_error(7) for information on how to determine whether an  error
42       has occurred when calling these functions.
43
44       The following errors can occur:
45
46       Domain error: x is an infinity
47              errno  is set to EDOM (but see BUGS).  An invalid floating-point
48              exception (FE_INVALID) is raised.
49
50       Range error: result overflow
51              An overflow floating-point exception (FE_OVERFLOW) is raised.
52

ATTRIBUTES

54       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
55       tributes(7).
56
57       ┌────────────────────────────────────────────┬───────────────┬─────────┐
58Interface                                   Attribute     Value   
59       ├────────────────────────────────────────────┼───────────────┼─────────┤
60tan(), tanf(), tanl()                       │ Thread safety │ MT-Safe │
61       └────────────────────────────────────────────┴───────────────┴─────────┘
62

STANDARDS

64       C11, POSIX.1-2008.
65

HISTORY

67       C99, POSIX.1-2001.
68
69       The variant returning double also conforms to SVr4, 4.3BSD, C89.
70

BUGS

72       Before  glibc  2.10, the glibc implementation did not set errno to EDOM
73       when a domain error occurred.
74

SEE ALSO

76       acos(3), asin(3), atan(3), atan2(3), cos(3), ctan(3), sin(3)
77
78
79
80Linux man-pages 6.04              2023-03-30                            tan(3)
Impressum