(math.h) - C++ Reference

cplusplus.com
  • TUTORIALS
  • REFERENCE
  • ARTICLES
  • FORUM

C++

  • Tutorials
  • Reference
  • Articles
  • Forum

Reference

  • C library:

    • <cassert> (assert.h)
    • <cctype> (ctype.h)
    • <cerrno> (errno.h)
    • C++11 <cfenv> (fenv.h)
    • <cfloat> (float.h)
    • C++11 <cinttypes> (inttypes.h)
    • <ciso646> (iso646.h)
    • <climits> (limits.h)
    • <clocale> (locale.h)
    • <cmath> (math.h)
    • <csetjmp> (setjmp.h)
    • <csignal> (signal.h)
    • <cstdarg> (stdarg.h)
    • C++11 <cstdbool> (stdbool.h)
    • <cstddef> (stddef.h)
    • C++11 <cstdint> (stdint.h)
    • <cstdio> (stdio.h)
    • <cstdlib> (stdlib.h)
    • <cstring> (string.h)
    • C++11 <ctgmath> (tgmath.h)
    • <ctime> (time.h)
    • C++11 <cuchar> (uchar.h)
    • <cwchar> (wchar.h)
    • <cwctype> (wctype.h)
  • Containers:

    • C++11 <array>
    • <deque>
    • C++11 <forward_list>
    • <list>
    • <map>
    • <queue>
    • <set>
    • <stack>
    • C++11 <unordered_map>
    • C++11 <unordered_set>
    • <vector>
  • Input/Output:

    • <fstream>
    • <iomanip>
    • <ios>
    • <iosfwd>
    • <iostream>
    • <istream>
    • <ostream>
    • <sstream>
    • <streambuf>
  • Multi-threading:

    • C++11 <atomic>
    • C++11 <condition_variable>
    • C++11 <future>
    • C++11 <mutex>
    • C++11 <thread>
  • Other:

    • <algorithm>
    • <bitset>
    • C++11 <chrono>
    • C++11 <codecvt>
    • <complex>
    • <exception>
    • <functional>
    • C++11 <initializer_list>
    • <iterator>
    • <limits>
    • <locale>
    • <memory>
    • <new>
    • <numeric>
    • C++11 <random>
    • C++11 <ratio>
    • C++11 <regex>
    • <stdexcept>
    • <string>
    • C++11 <system_error>
    • C++11 <tuple>
    • C++11 <type_traits>
    • C++11 <typeindex>
    • <typeinfo>
    • <utility>
    • <valarray>

<cmath> (math.h)

  • functions

    • abs
    • acos
    • C++11 acosh
    • asin
    • C++11 asinh
    • atan
    • atan2
    • C++11 atanh
    • C++11 cbrt
    • ceil
    • C++11 copysign
    • cos
    • cosh
    • C++11 erf
    • C++11 erfc
    • exp
    • C++11 exp2
    • C++11 expm1
    • fabs
    • C++11 fdim
    • floor
    • C++11 fma
    • C++11 fmax
    • C++11 fmin
    • fmod
    • C++11 fpclassify
    • frexp
    • C++11 hypot
    • C++11 ilogb
    • C++11 isfinite
    • C++11 isgreater
    • C++11 isgreaterequal
    • C++11 isinf
    • C++11 isless
    • C++11 islessequal
    • C++11 islessgreater
    • C++11 isnan
    • C++11 isnormal
    • C++11 isunordered
    • ldexp
    • C++11 lgamma
    • C++11 llrint
    • C++11 llround
    • log
    • log10
    • C++11 log1p
    • C++11 log2
    • C++11 logb
    • C++11 lrint
    • C++11 lround
    • modf
    • C++11 nan
    • C++11 nanf
    • C++11 nanl
    • C++11 nearbyint
    • C++11 nextafter
    • C++11 nexttoward
    • pow
    • C++11 remainder
    • C++11 remquo
    • C++11 rint
    • C++11 round
    • C++11 scalbln
    • C++11 scalbn
    • C++11 signbit
    • sin
    • sinh
    • sqrt
    • tan
    • tanh
    • C++11 tgamma
    • C++11 trunc
  • macro constants

    • HUGE_VAL
    • C++11 HUGE_VALF
    • C++11 HUGE_VALL
    • C++11 INFINITY
    • C++11 math_errhandling
    • NAN
  • types

    • C++11 double_t
    • float_t
  • Reference
  • <cmath>
header <cmath> (math.h) C numerics library Header <cmath> declares a set of functions to compute common mathematical operations and transformations:

Functions

Trigonometric functions

cosCompute cosine (function)sinCompute sine (function)tanCompute tangent (function)acosCompute arc cosine (function)asinCompute arc sine (function)atanCompute arc tangent (function)atan2Compute arc tangent with two parameters (function)

Hyperbolic functions

coshCompute hyperbolic cosine (function)sinhCompute hyperbolic sine (function)tanhCompute hyperbolic tangent (function)acosh Compute area hyperbolic cosine (function)asinh Compute area hyperbolic sine (function)atanh Compute area hyperbolic tangent (function)

Exponential and logarithmic functions

expCompute exponential function (function)frexpGet significand and exponent (function)ldexpGenerate value from significand and exponent (function)logCompute natural logarithm (function)log10Compute common logarithm (function)modfBreak into fractional and integral parts (function)exp2 Compute binary exponential function (function)expm1 Compute exponential minus one (function)ilogb Integer binary logarithm (function)log1p Compute logarithm plus one (function)log2 Compute binary logarithm (function)logb Compute floating-point base logarithm (function)scalbn Scale significand using floating-point base exponent (function)scalbln Scale significand using floating-point base exponent (long) (function)

Power functions

powRaise to power (function)sqrtCompute square root (function)cbrt Compute cubic root (function)hypot Compute hypotenuse (function)

Error and gamma functions

erf Compute error function (function)erfc Compute complementary error function (function)tgamma Compute gamma function (function)lgamma Compute log-gamma function (function)

Rounding and remainder functions

ceilRound up value (function)floorRound down value (function)fmodCompute remainder of division (function)trunc Truncate value (function)round Round to nearest (function)lround Round to nearest and cast to long integer (function)llround Round to nearest and cast to long long integer (function)rint Round to integral value (function)lrint Round and cast to long integer (function)llrint Round and cast to long long integer (function)nearbyint Round to nearby integral value (function)remainder Compute remainder (IEC 60559) (function)remquo Compute remainder and quotient (function)

Floating-point manipulation functions

copysign Copy sign (function)nan Generate quiet NaN (function)nextafter Next representable value (function)nexttoward Next representable value toward precise value (function)

Minimum, maximum, difference functions

fdim Positive difference (function)fmax Maximum value (function)fmin Minimum value (function)

Other functions

fabsCompute absolute value (function)absCompute absolute value (function)fma Multiply-add (function)

Macros / Functions

These are implemented as macros in C and as functions in C++:

Classification macro / functions

fpclassify Classify floating-point value (macro/function)isfinite Is finite value (macro)isinf Is infinity (macro/function)isnan Is Not-A-Number (macro/function)isnormal Is normal (macro/function)signbit Sign bit (macro/function)

Comparison macro / functions

isgreater Is greater (macro)isgreaterequal Is greater or equal (macro)isless Is less (macro)islessequal Is less or equal (macro)islessgreater Is less or greater (macro)isunordered Is unordered (macro)

Macro constants

math_errhandling Error handling (macro)INFINITY Infinity (constant)NANNot-A-Number (constant)HUGE_VALHuge value (constant)HUGE_VALF Huge float valueHUGE_VALL Huge long double value (constant) This header also defines the following macro constants (since C99/C++11):
macrotypedescription
MATH_ERRNO MATH_ERREXCEPTintBitmask value with the possible values math_errhandling can take.
FP_FAST_FMA FP_FAST_FMAF FP_FAST_FMALintEach, if defined, identifies for which type fma is at least as efficient as x*y+z.
FP_INFINITE FP_NAN FP_NORMAL FP_SUBNORMAL FP_ZEROintThe possible values returned by fpclassify.
FP_ILOGB0 FP_ILOGBNANintSpecial values the ilogb function may return.

Types

double_t Floating-point type (type)float_tFloating-point type (type) Home page | Privacy policy© cplusplus.com, 2000-2023 - All rights reserved - v3.3.4s Spotted an error? contact us

Từ khóa » Thư Viện Cmath Và Math.h