Numerics

Numerics

The C numerics library includes common mathematical functions and types, as well as support for random number generation.

Common mathematical functions

The header math.h provides standard C library mathematical functions such as fabs, sqrt, and sin.

Floating-point environment

The header fenv.h defines flags and functions related to exceptional floating-point state, such as overflow and division by zero.

Pseudo-random number generation

The header stdlib.h also includes C-style random number generation via srand and rand.

Complex number arithmetic

The header complex.h povides types and functions about complex numbers.

Type-generic math

The header tgmath.h provides some macros for a function which names XXX:

  • real function:
    • float variant XXXf
    • double variant XXX
    • long double variant XXXl
  • complex function:
    • float variant cXXXf
    • double variant cXXX
    • long double variant cXXXl

See also

C++ documentation for Numerics library

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/c/numeric

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部