33,311
社区成员
发帖
与我相关
我的任务
分享
/***
*math.h - definitions and declarations for math library
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
*Purpose:
* This file contains constant definitions and external subroutine
* declarations for the math subroutine library.
* [ANSI/System V]
*
* [Public]
*
****/
#ifndef _INC_MATH
#define _INC_MATH
#include <crtdefs.h>
#ifdef _MSC_VER
/*
* Currently, all MS C compilers for Win32 platforms default to 8 byte
* alignment.
*/
#pragma pack(push,_CRT_PACKING)
#endif /* _MSC_VER */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#ifndef __assembler
/* Definition of _exception struct - this struct is passed to the matherr
* routine when a floating point exception is detected
*/
#ifndef _EXCEPTION_DEFINED
struct _exception {
int type; /* exception type - see below */
char *name; /* name of function where error occured */
double arg1; /* first argument to function */
double arg2; /* second argument (if any) to function */
double retval; /* value to be returned by function */
} ;
#define _EXCEPTION_DEFINED
#endif /* _EXCEPTION_DEFINED */
/* Definition of a _complex struct to be used by those who use cabs and
* want type checking on their argument
*/
#ifndef _COMPLEX_DEFINED
struct _complex {
double x,y; /* real and imaginary parts */
} ;
#if !__STDC__ && !defined (__cplusplus)
/* Non-ANSI name for compatibility */
#define complex _complex
#endif /* !__STDC__ && !defined (__cplusplus) */
#define _COMPLEX_DEFINED
#endif /* _COMPLEX_DEFINED */
#endif /* __assembler */
/* Constant definitions for the exception type passed in the _exception struct
*/
#define _DOMAIN 1 /* argument domain error */
#define _SING 2 /* argument singularity */
#define _OVERFLOW 3 /* overflow range error */
#define _UNDERFLOW 4 /* underflow range error */
#define _TLOSS 5 /* total loss of precision */
#define _PLOSS 6 /* partial loss of precision */
#define EDOM 33
#define ERANGE 34
/* Definitions of _HUGE and HUGE_VAL - respectively the XENIX and ANSI names
* for a value returned in case of error by a number of the floating point
* math routines
*/
#ifndef __assembler
#if !defined (_M_CEE_PURE)
_CRTIMP extern double _HUGE;
#else /* !defined (_M_CEE_PURE) */
const double _HUGE = System::Double::PositiveInfinity;
#endif /* !defined (_M_CEE_PURE) */
#endif /* __assembler */
#define HUGE_VAL _HUGE
/* Function prototypes */
#if !defined (__assembler)
#ifndef _CRT_ABS_DEFINED
#define _CRT_ABS_DEFINED
int __cdecl abs(_In_ int _X);
long __cdecl labs(_In_ long _X);
#endif /* _CRT_ABS_DEFINED */
double __cdecl acos(_In_ double _X);
double __cdecl asin(_In_ double _X);
double __cdecl atan(_In_ double _X);
double __cdecl atan2(_In_ double _Y, _In_ double _X);
#ifndef _SIGN_DEFINED
_Check_return_ _CRTIMP double __cdecl _copysign (_In_ double _Number, _In_ double _Sign);
_Check_return_ _CRTIMP double __cdecl _chgsign (_In_ double _X);
#define _SIGN_DEFINED
#endif /* _SIGN_DEFINED */
double __cdecl cos(_In_ double _X);
double __cdecl cosh(_In_ double _X);
double __cdecl exp(_In_ double _X);
_CRT_JIT_INTRINSIC double __cdecl fabs(_In_ double _X);
double __cdecl fmod(_In_ double _X, _In_ double _Y);
double __cdecl log(_In_ double _X);
double __cdecl log10(_In_ double _X);
double __cdecl pow(_In_ double _X, _In_ double _Y);
double __cdecl sin(_In_ double _X);
double __cdecl sinh(_In_ double _X);
double __cdecl tan(_In_ double _X);
double __cdecl tanh(_In_ double _X);
double __cdecl sqrt(_In_ double _X);
#ifndef _CRT_ATOF_DEFINED
#define _CRT_ATOF_DEFINED
_Check_return_ _CRTIMP double __cdecl atof(_In_z_ const char *_String);
_Check_return_ _CRTIMP double __cdecl _atof_l(_In_z_ const char *_String, _In_opt_ _locale_t _Locale);
#endif /* _CRT_ATOF_DEFINED */