# tgmath

***

**1. Calculate the Sine of an Angle:**

```c
#include <tgmath.h>

double angle = 30.0;
double sine = sin(angle * M_PI / 180.0);
```

**2. Find the Cosine of an Angle:**

```c
#include <tgmath.h>

double angle = 45.0;
double cosine = cos(angle * M_PI / 180.0);
```

**3. Determine the Tangent of an Angle:**

```c
#include <tgmath.h>

double angle = 60.0;
double tangent = tan(angle * M_PI / 180.0);
```

**4. Calculate the Inverse Sine (Arcsine) of a Value:**

```c
#include <tgmath.h>

double value = 0.5;
double arcsine = asin(value);
```

**5. Find the Inverse Cosine (Arccosine) of a Value:**

```c
#include <tgmath.h>

double value = 0.75;
double arccosine = acos(value);
```

**6. Determine the Inverse Tangent (Arctangent) of a Value:**

```c
#include <tgmath.h>

double value = 1.0;
double arctangent = atan(value);
```

**7. Calculate the Square Root of a Number:**

```c
#include <tgmath.h>

double number = 16.0;
double square_root = sqrt(number);
```

**8. Find the Cube Root of a Number:**

```c
#include <tgmath.h>

double number = 27.0;
double cube_root = cbrt(number);
```

**9. Calculate the Exponential Function of a Number:**

```c
#include <tgmath.h>

double base = 2.0;
double exponent = 3.0;
double exponential = pow(base, exponent);
```

**10. Find the Logarithm (Base 10) of a Number:**

```c
#include <tgmath.h>

double number = 100.0;
double logarithm = log10(number);
```

**11. Calculate the Logarithm (Base 2) of a Number:**

```c
#include <tgmath.h>

double number = 32.0;
double logarithm = log2(number);
```

**12. Determine the Natural (Base e) Logarithm of a Number:**

```c
#include <tgmath.h>

double number = 10.0;
double logarithm = log(number);
```

**13. Calculate the Hyperbolic Sine of a Value:**

```c
#include <tgmath.h>

double value = 1.0;
double hyperbolic_sine = sinh(value);
```

**14. Find the Hyperbolic Cosine of a Value:**

```c
#include <tgmath.h>

double value = 1.0;
double hyperbolic_cosine = cosh(value);
```

**15. Determine the Hyperbolic Tangent of a Value:**

```c
#include <tgmath.h>

double value = 1.0;
double hyperbolic_tangent = tanh(value);
```

**16. Calculate the Inverse Hyperbolic Sine (Arcsinh) of a Value:**

```c
#include <tgmath.h>

double value = 1.0;
double arcsinh = asinh(value);
```

**17. Find the Inverse Hyperbolic Cosine (Arccosh) of a Value:**

```c
#include <tgmath.h>

double value = 1.5;
double arccosh = acosh(value);
```

**18. Determine the Inverse Hyperbolic Tangent (Arctanh) of a Value:**

```c
#include <tgmath.h>

double value = 0.5;
double arctanh = atanh(value);
```

**19. Calculate the Error Function (erf) of a Value:**

```c
#include <tgmath.h>

double value = 0.5;
double erf = erf(value);
```

**20. Find the Complementary Error Function (erfc) of a Value:**

```c
#include <tgmath.h>

double value = 0.5;
double erfc = erfc(value);
```

**21. Calculate the Gamma Function of a Value:**

```c
#include <tgmath.h>

double value = 5.0;
double gamma = tgamma(value);
```

**22. Find the Log Gamma Function of a Value:**

```c
#include <tgmath.h>

double value = 5.0;
double log_gamma = lgamma(value);
```

**23. Calculate the Beta Function of Two Values:**

```c
#include <tgmath.h>

double a = 2.0;
double b = 3.0;
double beta = beta(a, b);
```

**24. Find the Digamma Function (Polygamma Function of Order 0) of a Value:**

```c
#include <tgmath.h>

double value = 5.0;
double digamma = tgamma(value);
```

**25. Calculate the Round-to-Nearest Integer Function:**

```c
#include <tgmath.h>

double value = 2.5;
double rounded = round(value);
```

**26. Find the Ceiling Function (Round-Up to Nearest Integer):**

```c
#include <tgmath.h>

double value = 2.2;
double ceil = ceil(value);
```

**27. Calculate the Floor Function (Round-Down to Nearest Integer):**

```c
#include <tgmath.h>

double value = 2.8;
double floor = floor(value);
```

**28. Find the Modulus (Remainder after Division):**

```c
#include <tgmath.h>

double dividend = 10.0;
double divisor = 3.0;
double modulus = fmod(dividend, divisor);
```

**29. Calculate the Sign of a Number:**

```c
#include <tgmath.h>

double number = -5.0;
int sign = signbit(number);
```

**30. Find the Maximum Value of Two Numbers:**

```c
#include <tgmath.h>

double a = 10.0;
double b = 5.0;
double max_value = fmax(a, b);
```

**31. Calculate the Minimum Value of Two Numbers:**

```c
#include <tgmath.h>

double a = 10.0;
double b = 5.0;
double min_value = fmin(a, b);
```

**32. Find the Absolute Value (Magnitude) of a Number:**

```c
#include <tgmath.h>

double number = -5.0;
double absolute_value = fabs(number);
```

**33. Calculate the Remainder of a Division:**

```c
#include <tgmath.h>

double dividend = 10.0;
double divisor = 3.0;
double remainder = remainder(dividend, divisor);
```

**34. Find the Greatest Common Divisor of Two Numbers:**

```c
#include <tgmath.h>

int a = 12;
int b = 18;
int gcd = __gcd(a, b);
```

**35. Calculate the Least Common Multiple of Two Numbers:**

```c
#include <tgmath.h>

int a = 12;
int b = 18;
int lcm = a * b / __gcd(a, b);
```

**36. Find the Hypergeometric Function (2F1):**

```c
#include <tgmath.h>

double a = 1.0;
double b = 2.0;
double c = 3.0;
double z = 0.5;
double hypergeometric = h2f1(a, b, c, z);
```

**37. Calculate the Regularized Incomplete Gamma Function:**

```c
#include <tgmath.h>

double a = 2.0;
double b = 3.0;
double x = 0.5;
double regularized_incomplete_gamma = gammainc(a, b, x);
```

**38. Find the Modified Bessel Function of the First Kind (I):**

```c
#include <tgmath.h>

double nu = 2.0;
double x = 0.5;
double modified_bessel_I = bessi(nu, x);
```

**39. Calculate the Modified Bessel Function of the Second Kind (K):**

```c
#include <tgmath.h>

double nu = 2.0;
double x = 0.5;
double modified_bessel_K = bessk(nu, x);
```

**40. Find the Struve Function (H):**

```c
#include <tgmath.h>

double nu = 2.0;
double x = 0.5;
double struve_H = struveh(nu, x);
```

**41. Calculate the Lommel Function (S):**

```c
#include <tgmath.h>

double mu = 2.0;
double nu = 3.0;
double x = 0.5;
double lommel_S = lommels(mu, nu, x);
```

**42. Find the Jacobi Elliptic Function (sn):**

```c
#include <tgmath.h>

double m = 2.0;
double u = 0.5;
double elliptic_sn = j0(m, u);
```

**43. Calculate the Jacobi Elliptic Function (cn):**

```c
#include <tgmath.h>

double m = 2.0;
double u = 0.5;
double elliptic_cn = j1(m, u);
```

**44. Find the Jacobi Elliptic Function (dn):**

```c
#include <tgmath.h>

double m = 2.0;
double u = 0.5;
double elliptic_dn = j2(m, u);
```

**45. Calculate the Weierstrass Elliptic Function (℘):**

```c
#include <tgmath.h>

double g2 = 2.0;
double g3 = 3.0;
double z = 0.5;
double elliptic_p = pw(g2, g3, z);
```

**46. Find the Zeta Function:**

```c
#include <tgmath.h>

double s = 2.0;
double zeta = zeta(s);
```

**47. Calculate the Riemann Riemann Zeta Function:**

```c
#include <tgmath.h>

double s = 2.0;
double zeta = rzeta(s);
```

**48. Find the Lambert W Function:**

```c
#include <tgmath.h>

double x = 0.5;
double lambert_W = lambertw(x);
```

**49. Calculate the Exp Integral Function (E₁):**

```c
#include <tgmath.h>

double x = 0.5;
double exp_integral_E1 = expint(1, x);
```

**50. Find the Dawson Integral Function (F):**

```c
#include <tgmath.h>

double x = 0.5;
double dawson_F = dawson(x);
```
