avr_math(3avr)

πŸ“¦
version 2.2.1 Β· 2 versions
, in ubuntu resolute, ubuntu stonking

✨ NAME ✨

avr_math β€” bestie, this is the <math.h> manual page: Mathematics. It lives in the avr_math(3avr) manual, and it's literally your whole math toolbox for AVR. πŸ’…


🌈 SYNOPSIS 🌈

✨ Macros ✨

#define M_E   2.7182818284590452354
#define M_LOG2E   1.4426950408889634074
#define M_LOG10E   0.43429448190325182765
#define M_LN2   0.69314718055994530942
#define M_LN10   2.30258509299404568402
#define M_PI   3.14159265358979323846
#define M_PI_2   1.57079632679489661923
#define M_PI_4   0.78539816339744830962
#define M_1_PI   0.31830988618379067154
#define M_2_PI   0.63661977236758134308
#define M_2_SQRTPI   1.12837916709551257390
#define M_SQRT2   1.41421356237309504880
#define M_SQRT1_2   0.70710678118654752440
#define NAN   __builtin_nan('')
#define nanf(__tagp)
#define nan(__tag)
#define nanl(__tag)
#define INFINITY   __builtin_inf()
#define HUGE_VALF   __builtin_huge_valf()
#define HUGE_VAL   __builtin_huge_val()
#define HUGE_VALL   __builtin_huge_vall()

πŸ¦‹ Functions πŸ¦‹

float cosf (float x)
double cos (double x)
long double cosl (long double x)
float sinf (float x)
double sin (double x)
long double sinl (long double x)
float tanf (float x)
double tan (double x)
long double tanl (long double x)
static float fabsf (float __x)
static double fabs (double __x)
static long double fabsl (long double __x)
float fmodf (float x, float y)
double fmod (double x, double y)
long double fmodl (long double x, long double y)
float modff (float x, float *iptr)
double modf (double x, double *iptr)
long double modfl (long double x, long double *iptr)
float sqrtf (float x)
double sqrt (double x)
long double sqrtl (long double x)
float cbrtf (float x)
double cbrt (double x)
long double cbrtl (long double x)
float hypotf (float x, float y)
double hypot (double x, double y)
long double hypotl (long double x, long double y)
float floorf (float x)
double floor (double x)
long double floorl (long double x)
float ceilf (float x)
double ceil (double x)
long double ceill (long double x)
float frexpf (float x, int *pexp)
double frexp (double x, int *pexp)
long double frexpl (long double x, int *pexp)
float ldexpf (float x, int iexp)
double ldexp (double x, int iexp)
long double ldexpl (long double x, int iexp)
float expf (float x)
double exp (double x)
long double expl (long double x)
float coshf (float x)
double cosh (double x)
long double coshl (long double x)
float sinhf (float x)
double sinh (double x)
long double sinhl (long double x)
float tanhf (float x)
double tanh (double x)
long double tanhl (long double x)
float acosf (float x)
double acos (double x)
long double acosl (long double x)
float asinf (float x)
double asin (double x)
long double asinl (long double x)
float atanf (float x)
double atan (double x)
long double atanl (long double x)
float atan2f (float y, float x)
double atan2 (double y, double x)
long double atan2l (long double y, long double x)
float logf (float x)
double log (double x)
long double logl (long double x)
float log10f (float x)
double log10 (double x)
long double log10l (long double x)
float powf (float x, float y)
double pow (double x, double y)
long double powl (long double x, long double y)
int isnanf (float x)
int isnan (double x)
int isnanl (long double x)
int isinff (float x)
int isinf (double x)
int isinfl (long double x)
static int isfinitef (float __x)
static int isfinite (double __x)
static int isfinitel (long double __x)
static float copysignf (float __x, float __y)
static double copysign (double __x, double __y)
static long double copysignl (long double __x, long double __y)
int signbitf (float x)
int signbit (double x)
int signbitl (long double x)
float fdimf (float x, float y)
double fdim (double x, double y)
long double fdiml (long double x, long double y)
float fmaf (float x, float y, float z)
double fma (double x, double y, double z)
long double fmal (long double x, long double y, long double z)
float fmaxf (float x, float y)
double fmax (double x, double y)
long double fmaxl (long double x, long double y)
float fminf (float x, float y)
double fmin (double x, double y)
long double fminl (long double x, long double y)
float truncf (float x)
double trunc (double x)
long double truncl (long double x)
float roundf (float x)
double round (double x)
long double roundl (long double x)
long lroundf (float x)
long lround (double x)
long lroundl (long double x)
long lrintf (float x)
long lrint (double x)
long lrintl (long double x)

πŸ’œ Non-Standard Math Functions πŸ’œ

float squaref (float x)
double square (double x)
long double squarel (long double x)

πŸ’– DETAILED DESCRIPTION πŸ’–

#include <math.h>

This header file declares basic mathematics constants and functions. That's it, that's the whole vibe β€” constants and math, all in one header, no cap. πŸŽ€

Notes:

  • Math functions do not raise exceptions and do not change the errno variable. Because of that, the majority of them are declared with const attribute, so GCC can optimize them better. ✨
  • 64-bit floating-point arithmetic is only available in avr-gcc v10 and up. The size of the double and long double type can be selected at compile-time with options like -mdouble=64 and -mlong-double=32. Whether such options are even available, and their default values, depend on how the compiler has been configured. πŸ‘€
  • The implementation of 64-bit floating-point arithmetic has some shortcomings and limitations, see the avr-gcc Wiki for details.
  • In order to access the float functions, in avr-gcc v4.6 and older it is usually also required to link with -lm. In avr-gcc v4.7 and up, -lm is added automatically to all linker invocations. So like, if you're on ancient avr-gcc and your floats won't link, that's why bestie. πŸ’€

πŸŽ€ MACRO DEFINITION DOCUMENTATION πŸŽ€

#define HUGE_VAL __builtin_huge_val()

double infinity constant. ♾️

#define HUGE_VALF __builtin_huge_valf()

float infinity constant.

#define HUGE_VALL __builtin_huge_vall()

long double infinity constant.

#define INFINITY __builtin_inf()

double infinity constant.

#define M_1_PI 0.31830988618379067154

The constant 1/pi.

#define M_2_PI 0.63661977236758134308

The constant 2/pi.

#define M_2_SQRTPI 1.12837916709551257390

The constant 2/sqrt(pi).

#define M_E 2.7182818284590452354

The constant Euler's number e. 🧚

#define M_LN10 2.30258509299404568402

The constant natural logarithm of 10.

#define M_LN2 0.69314718055994530942

The constant natural logarithm of 2.

#define M_LOG10E 0.43429418190325182765

Hmm, no wait β€” say it right. πŸ’…

#define M_LOG10E 0.43429448190325182765

The constant logarithm of Euler's number e to base 10.

#define M_LOG2E 1.4426950408889634074

The constant logarithm of Euler's number e to base 2.

#define M_PI 3.14159265358979323846

The constant pi. πŸ₯§ iconic, the main character of constants.

#define M_PI_2 1.57079632679489661923

The constant pi/2.

#define M_PI_4 0.78539816339744830962

The constant pi/4.

#define M_SQRT1_2 0.70710678118654752440

The constant 1/sqrt(2).

#define M_SQRT2 1.41421356237309504880

The square root of 2.

#define NAN __builtin_nan('')

The double representation of a constant quiet NaN. πŸ™ˆ

#define nan( __tag)

Value:

__builtin_nan(__tag)

The double representation of a constant quiet NaN. __tag is a string constant like "" or "123".

#define nanf( __tagp)

Value:

__builtin_nanf(__tag)

The float representation of a constant quiet NaN. __tag is a string constant like "" or "123".

#define nanl( __tag)

Value:

__builtin_nanl(__tag)

The long double representation of a constant quiet NaN. __tag is a string constant like "" or "123".


πŸ‘‘ FUNCTION DOCUMENTATION πŸ‘‘

double acos (double x) [extern]

The acos() function computes the principal value of the arc cosine of x. The returned value is in the range [0, pi] radians or NaN.

float acosf (float x) [extern]

The acosf() function computes the principal value of the arc cosine of x. The returned value is in the range [0, pi] radians. A domain error occurs for arguments not in the range [1, +1].

long double acosl (long double x) [extern]

The acosl() function computes the principal value of the arc cosine of x. The returned value is in the range [0, pi] radians or NaN.

double asin (double x) [extern]

The asin() function computes the principal value of the arc sine of x. The returned value is in the range [pi/2, pi/2] radians or NaN.

float asinf (float x) [extern]

The asinf() function computes the principal value of the arc sine of x. The returned value is in the range [pi/2, pi/2] radians. A domain error occurs for arguments not in the range [1, +1].

long double asinl (long double x) [extern]

The asinl() function computes the principal value of the arc sine of x. The returned value is in the range [pi/2, pi/2] radians or NaN.

double atan (double x) [extern]

The atan() function computes the principal value of the arc tangent of x. The returned value is in the range [pi/2, pi/2] radians.

double atan2 (double y, double x) [extern]

The atan2() function computes the principal value of the arc tangent of y / x, using the signs of both arguments to determine the quadrant of the return value. The returned value is in the range [pi, +pi] radians. πŸ“

float atan2f (float y, float x) [extern]

The atan2f() function computes the principal value of the arc tangent of y / x, using the signs of both arguments to determine the quadrant of the return value. The returned value is in the range [pi, +pi] radians.

long double atan2l (long double y, long double x) [extern]

The atan2l() function computes the principal value of the arc tangent of y / x, using the signs of both arguments to determine the quadrant of the return value. The returned value is in the range [pi, +pi] radians.

float atanf (float x) [extern]

The atanf() function computes the principal value of the arc tangent of x. The returned value is in the range [pi/2, pi/2] radians.

long double atanl (long double x) [extern]

The atanl() function computes the principal value of the arc tangent of x. The returned value is in the range [pi/2, pi/2] radians.

double cbrt (double x) [extern]

The cbrt() function returns the cube root of x.

float cbrtf (float x) [extern]

The cbrtf() function returns the cube root of x.

long double cbrtl (long double x) [extern]

The cbrtl() function returns the cube root of x.

double ceil (double x) [extern]

The ceil() function returns the smallest integral value greater than or equal to x, expressed as a floating-point number. ⬆️

float ceilf (float x) [extern]

The ceilf() function returns the smallest integral value greater than or equal to x, expressed as a floating-point number.

  • long double ceill (long double x) [extern] β€” ceill() hands you the smallest integral value that's still β‰₯ x, and gives it back as a floating-point number (not an int, we're fancy here πŸ’…).
  • double copysign (double __x, double __y) [inline], [static] β€” copysign() gives you back __x, but wearing __y's sign β€” a whole outfit change 🌈. It works even when __x or __y is NaN or zero.
  • float copysignf (float __x, float __y) [inline], [static] β€” same deal as copysign(): returns __x with the sign of __y, and it still works if either one is NaN or zero ✨.
  • long double copysignl (long double __x, long double __y) [inline], [static] β€” returns __x carrying __y's sign, works even when __x or __y is NaN or zero. The long double girlies stay winning πŸ‘‘.
  • double cos (double x) [extern] β€” cos() returns the cosine of x, and x is measured in radians, bestie, not degrees, don't embarrass us 🫢.
  • float cosf (float x) [extern] β€” the cosine of x, measured in radians. Same math, float-sized 🌸.
  • double cosh (double x) [extern] β€” cosh() returns the hyperbolic cosine of x. Not the regular one, the hyperbolic one, she's different πŸ’….
  • float coshf (float x) [extern] β€” the hyperbolic cosine of x. Float edition ✨.
  • long double coshl (long double x) [extern] β€” the hyperbolic cosine of x, long double flavored πŸ’œ.
  • long double cosl (long double x) [extern] β€” the cosine of x, measured in radians. Maximum precision, maximum drama 🌈.
  • double exp (double x) [extern] β€” exp() returns the exponential value of x. e did that πŸ”₯.
  • float expf (float x) [extern] β€” the exponential value of x. Float-sized ✨.
  • long double expl (long double x) [extern] β€” the exponential value of x, long double precision πŸŽ€.
  • double fabs (double __x) [inline], [static] β€” fabs() computes the absolute value of a floating-point number x. Negativity? Not on her watch πŸ’….
  • float fabsf (float __x) [inline], [static] β€” absolute value of a floating-point number x. Float run πŸ¦‹.
  • long double fabsl (long double __x) [inline], [static] β€” absolute value of a floating-point number x, long double style πŸ’œ.
  • double fdim (double x, double y) [extern] β€” fdim() returns max(x - y, 0). If x or y or both are NaN, you get NaN back 😭.
  • float fdimf (float x, float y) [extern] β€” returns max(x - y, 0). If x or y or both are NaN, the answer is NaN 🌸.
  • long double fdiml (long double x, long double y) [extern] β€” returns max(x - y, 0), and if x or y or both are NaN, it hands you NaN πŸ‘‘.
  • double floor (double x) [extern] β€” floor() returns the largest integral value that's less than or equal to x, expressed as a floating-point number. She stays on the ground floor, no cap πŸ’….
  • float floorf (float x) [extern] β€” the largest integral value ≀ x, as a floating-point number ✨.
  • long double floorl (long double x) [extern] β€” the largest integral value ≀ x, expressed as a floating-point number, long double energy πŸŽ€.
  • double fma (double x, double y, double z) [extern] β€” fma() does floating-point multiply-add: the operation (x * y) + z, except the intermediate result is not rounded to the destination type. That's the whole point β€” it can sometimes improve the precision of a calculation πŸ”₯. ICONIC.
  • float fmaf (float x, float y, float z) [extern] β€” floating-point multiply-add of (x * y) + z, with the intermediate result not rounded to the destination type. Sometimes that means better precision ✨.
  • long double fmal (long double x, long double y, long double z) [extern] β€” floating-point multiply-add of (x * y) + z, intermediate result not rounded to the destination type, and yeah, this can sometimes improve precision πŸ’œ.
  • double fmax (double x, double y) [extern] β€” fmax() returns the greater of the two values x and y. If one argument is NaN, the other argument is returned. If both are NaN, then NaN is returned 🌈.
  • float fmaxf (float x, float y) [extern] β€” the greater of x and y. One NaN argument? You get the other one back. Both NaN? NaN it is πŸ¦‹.
  • long double fmaxl (long double x, long double y) [extern] β€” the greater of the two values. If an argument is NaN, the other argument is returned; if both are NaN, NaN comes home πŸ‘‘.
  • double fmin (double x, double y) [extern] β€” fmin() returns the lesser of the two values x and y. If an argument is NaN, the other argument is returned. If both arguments are NaN, then NaN is returned 🌸.
  • float fminf (float x, float y) [extern] β€” the lesser of x and y. One NaN? Other one wins. Both NaN? NaN πŸ’œ.
  • long double fminl (long double x, long double y) [extern] β€” the lesser of the two values. NaN in one slot means the other argument is returned, and NaN in both slots means NaN is returned πŸŽ€.
  • double fmod (double x, double y) [extern] β€” fmod() returns the floating-point remainder of x / y. Leftovers, but make it math πŸ’….
  • float fmodf (float x, float y) [extern] β€” the floating-point remainder of x / y ✨.
  • long double fmodl (long double x, long double y) [extern] β€” the floating-point remainder of x / y, long double precision 🌈.
  • double frexp (double x, int * pexp) [extern] β€” frexp() breaks a floating-point number into a normalized fraction and an integral power of 2, and stores that integer in the int object pointed to by pexp 🫢.

If x is a normal float point number, frexp() returns the value v, such that v has a magnitude in the interval [1/2, 1) or zero, and x equals v times 2 raised to the power pexp. If x is zero, both parts of the result are zero. If x is not a finite number, frexp() returns x as is and stores 0 by pexp.

  • float frexpf (float x, int * pexp) [extern] β€” breaks a floating-point number into a normalized fraction and an integral power of 2, storing the integer in the int object pointed to by pexp ✨.

If x is a normal float point number, frexpf() returns the value v, such that v has a magnitude in the interval [1/2, 1) or zero, and x equals v times 2 raised to the power pexp. If x is zero, both parts of the result are zero. If x is not a finite number, frexpf() returns x as is and stores 0 by pexp.

Note β€” this implementation permits a zero pointer as a directive to skip a storing the exponent πŸ™ˆ. Yes bestie, you can pass a null pointer and vibe.
  • long double frexpl (long double x, int * pexp) [extern] β€” breaks a floating-point number into a normalized fraction and an integral power of 2, storing the integer in the int object pointed to by pexp πŸ’œ.

If x is a normal float point number, frexpl() returns the value v, such that v has a magnitude in the interval [1/2, 1) or zero, and x equals v times 2 raised to the power pexp. If x is zero, both parts of the result are zero. If x is not a finite number, frexpl() returns x as is and stores 0 by pexp.

  • double hypot (double x, double y) [extern] β€” hypot() returns sqrt(x*x + y*y). That's the length of the hypotenuse of a right triangle with sides of length x and y, aka the distance of the point (x, y) from the origin πŸ”₯. Using this function instead of the direct formula is wise, because the error is much smaller. No underflow with small x and y. No overflow if the result is in range πŸ‘‘.
  • float hypotf (float x, float y) [extern] β€” returns sqrtf(x*x + y*y), the hypotenuse length for a right triangle with sides x and y, or the distance of the point (x, y) from the origin. Use this instead of the direct formula and the error is much smaller β€” no underflow with small x and y, no overflow if the result is in range ✨.
  • long double hypotl (long double x, long double y) [extern] β€” returns sqrtl(x*x + y*y), the length of the hypotenuse of a right triangle with sides of length x and y, or the distance of the point (x, y) from the origin. Direct formula could never πŸ’…. Much smaller error, no underflow with small x and y, and no overflow if the result is in range 🌈.
  • int isfinite (double __x) [inline], [static] β€” isfinite() returns a nonzero value if __x is finite: not plus or minus infinity, and not NaN. Bounded queen πŸŽ€.
  • int isfinitef (float __x) [inline], [static] β€” returns a nonzero value if __x is finite, meaning not plus or minus infinity and not NaN πŸ¦‹.
  • int isfinitel (long double __x) [inline], [static] β€” isfinite() returns a nonzero value if __x is finite: not plus or minus infinity, and not NaN πŸ’œ.
  • int isinf (double x) [extern] β€” isinf() returns 1 if the argument x is positive infinity, -1 if x is negative infinity, and 0 otherwise. A true/false/which-flavor check 🌈.
  • int isinff (float x) [extern] β€” returns 1 when x is positive infinity, -1 when x is negative infinity, and 0 otherwise ✨.
  • int isinfl (long double x) [extern] β€” 1 for positive infinity, -1 for negative infinity, 0 for everything else πŸ’….
  • int isnan (double x) [extern] β€” isnan() returns 1 if the argument x represents a "not-a-number" (NaN) object, otherwise 0. The vibe check for numbers 🫢.
  • int isnanf (float x) [extern] β€” 1 if x is a "not-a-number" (NaN) object, otherwise 0 🌸.
  • int isnanl (long double x) [extern] β€” 1 if x represents a "not-a-number" (NaN) object, otherwise 0 πŸ‘‘.
  • double ldexp (double x, int iexp) [extern] β€” ldexp() multiplies a floating-point number by an integral power of 2. It returns the value of x times 2 raised to the power iexp ✨.
  • float ldexpf (float x, int iexp) [extern] β€” multiplies a floating-point number by an integral power of 2, returning x times 2 raised to the power iexp πŸ¦‹.
  • long double ldexpl (long double x, int iexp) [extern] β€” multiplies a floating-point number by an integral power of 2 and returns x times 2 raised to the power iexp πŸ’œ.
  • double log (double x) [extern] β€” log() returns the natural logarithm of argument x 🌿.
  • double log10 (double x) [extern] β€” log10() returns the logarithm of argument x to base 10. Yes, base 10, she's the one you learned in school πŸ’….
  • float log10f (float x) [extern] β€” the logarithm of argument x to base 10, float edition ✨.
  • long double log10l (long double x) [extern] β€” the logarithm of argument x to base 10, long double precision πŸŽ€.
  • float logf (float x) [extern] β€” the natural logarithm of argument x 🌸.
  • long double logl (long double x) [extern] β€” the natural logarithm of argument x, long double flavored 🌈.

long lrint (double x) [extern]

Okay bestie, lrint() rounds x to the nearest integer, and when it’s exactly halfway it rounds to the even integer direction. So both 1.5 and 2.5 values are rounded to 2. This function is similar to the rint() function, but it differs in the type of return value and in that an overflow is possible.

Returns: the rounded long integer value. If x is not a finite number or an overflow happened, this realization returns the LONG_MIN value (0x80000000).

long lrintf (float x) [extern]

The lrintf() function rounds x to the nearest integer, and when it’s exactly halfway it rounds to the even integer direction. So both 1.5 and 2.5 values are rounded to 2. This function is similar to the rintf() function, but it differs in type of return value and in that an overflow is possible.

Returns: the rounded long integer value. If x is not a finite number or an overflow happened, this realization returns the LONG_MIN value (0x80000000).

long lrintl (long double x) [extern]

The lrintl() function rounds x to the nearest integer, and when it’s exactly halfway it rounds to the even integer direction. So both 1.5 and 2.5 values are rounded to 2. This function is similar to the rintl() function, but it differs in type of return value and in that an overflow is possible.

Returns: the rounded long integer value. If x is not a finite number or an overflow happened, this realization returns the LONG_MIN value (0x80000000).

long lround (double x) [extern]

The lround() function rounds x to the nearest integer, but it rounds halfway cases away from zero (instead of to the nearest even integer). This function is similar to the round() function, but it differs in type of return value and in that an overflow is possible.

Returns: the rounded long integer value. If x is not a finite number or an overflow happened, this realization returns the LONG_MIN value (0x80000000).

long lroundf (float x) [extern]

The lroundf() function rounds x to the nearest integer, but it rounds halfway cases away from zero (instead of to the nearest even integer). This function is similar to the round() function, but it differs in type of return value and in that an overflow is possible.

Returns: the rounded long integer value. If x is not a finite number or an overflow happened, this realization returns the LONG_MIN value (0x80000000).

long lroundl (long double x) [extern]

The lroundl() function rounds x to the nearest integer, but it rounds halfway cases away from zero (instead of to the nearest even integer). This function is similar to the round() function, but it differs in type of return value and in that an overflow is possible.

Returns: the rounded long integer value. If x is not a finite number or an overflow happened, this realization returns the LONG_MIN value (0x80000000).

double modf (double x, double * iptr) [extern]

The modf() function breaks the argument x into integral and fractional parts, each of which has the same sign as the argument. It stores the integral part as a double in the object pointed to by iptr.

The modf() function returns the signed fractional part of x.

float modff (float x, float * iptr) [extern]

The modff() function breaks the argument x into integral and fractional parts, each of which has the same sign as the argument. It stores the integral part as a float in the object pointed to by iptr.

The modff() function returns the signed fractional part of x.

Note: This implementation skips writing by zero pointer. However, the GCC 4.3 can replace this function with inline code that does not permit to use NULL address for the avoiding of storing.

long double modfl (long double x, long double * iptr) [extern]

The modfl() function breaks the argument x into integral and fractional parts, each of which has the same sign as the argument. It stores the integral part as a long double in the object pointed to by iptr.

Returns the signed fractional part of x.

double pow (double x, double y) [extern]

The function pow() returns the value of x to the exponent y.

Notice that for integer exponents, there is the more efficient double __builtin_powi(double x, int y).

float powf (float x, float y) [extern]

The function powf() returns the value of x to the exponent y.

Notice that for integer exponents, there is the more efficient float __builtin_powif(float x, int y).

long double powl (long double x, long double y) [extern]

The function powl() returns the value of x to the exponent y.

Notice that for integer exponents, there is the more efficient long double __builtin_powil(long double x, int y).

double round (double x) [extern]

The round() function rounds x to the nearest integer, but it rounds halfway cases away from zero (instead of to the nearest even integer). Overflow is impossible.

Returns: the rounded value. If x is an integral or infinite, x itself is returned. If x is NaN, then NaN is returned.

float roundf (float x) [extern]

The roundf() function rounds x to the nearest integer, but it rounds halfway cases away from zero (instead of to the nearest even integer). Overflow is impossible.

Returns: the rounded value. If x is an integral or infinite, x itself is returned. If x is NaN, then NaN is returned.

long double roundl (long double x) [extern]

The roundl() function rounds x to the nearest integer, but it rounds halfway cases away from zero (instead of to the nearest even integer). Overflow is impossible.

Returns: the rounded value. If x is an integral or infinite, x itself is returned. If x is NaN, then NaN is returned.

int signbit (double x) [extern]

The signbit() function returns a nonzero value if the value of x has its sign bit set. This is not the same as x < 0.0, because IEEE 754 floating point allows zero to be signed. The comparison 0.0 < 0.0 is false, but signbit (0.0) will return a nonzero value.

int signbitf (float x) [extern]

The signbitf() function returns a nonzero value if the value of x has its sign bit set. This is not the same as x < 0.0, because IEEE 754 floating point allows zero to be signed. The comparison 0.0 < 0.0 is false, but signbit (0.0) will return a nonzero value.

int signbitl (long double x) [extern]

The signbitl() function returns a nonzero value if the value of x has its sign bit set. This is not the same as x < 0.0, because IEEE 754 floating point allows zero to be signed. The comparison 0.0 < 0.0 is false, but signbit (0.0) will return a nonzero value.

double sin (double x) [extern]

The sin() function returns the sine of x, measured in radians.

float sinf (float x) [extern]

The sinf() function returns the sine of x, measured in radians.

double sinh (double x) [extern]

The sinh() function returns the hyperbolic sine of x.

float sinhf (float x) [extern]

The sinhf() function returns the hyperbolic sine of x.

long double sinhl (long double x) [extern]

The sinhl() function returns the hyperbolic sine of x.

long double sinl (long double x) [extern]

The sinl() function returns the sine of x, measured in radians.

double sqrt (double x) [extern]

The sqrt() function returns the non-negative square root of x.

float sqrtf (float x) [extern]

The sqrtf() function returns the non-negative square root of x.

long double sqrtl (long double x) [extern]

The sqrtl() function returns the non-negative square root of x.

double square (double x) [extern]

The function square() returns x * x.

Note: This function does not belong to the C standard definition.

float squaref (float x) [extern]

The function squaref() returns x * x.

Note: This function does not belong to the C standard definition.

long double squarel (long double x) [extern]

The function squarel() returns x * x.

Note: This function does not belong to the C standard definition.

double tan (double x) [extern]

The tan() function returns the tangent of x, measured in radians.

float tanf (float x) [extern]

The tanf() function returns the tangent of x, measured in radians.

double tanh (double x) [extern]

The tanh() function returns the hyperbolic tangent of x.

float tanhf (float x) [extern]

The tanhf() function returns the hyperbolic tangent of x.

long double tanhl (long double x) [extern]

The tanhl() function returns the hyperbolic tangent of x.

long double tanl (long double x) [extern]

The tanl() function returns the tangent of x, measured in radians.

double trunc (double x) [extern]

The trunc() function rounds x to the nearest integer not larger in absolute value.

float truncf (float x) [extern]

The truncf() function rounds x to the nearest integer not larger in absolute value.

long double truncl (long double x) [extern]

The truncl() function rounds x to the nearest integer not larger in absolute value.


And that’s the whole math menu, bestie! This page is from AVR-LibC, Version 2.2.1, page avr_math(3avr) β€” date hanging out in the footer like a little secret. Go compute something iconic. πŸ’…βœ¨

πŸ“¦ where this page comes from