'Watcom C Library reference'에 해당되는 글 62건

  1. 2021.06.14 Watcom C Library Reference : asin, asinh, assert, atan, atan2, atanh

 

 

WATCOM C Library Reference : asin, asinh, assert, atan, atan2, atanh

 

 

 

 

asin

 

Synopsis : #include <math.h> 

              double asin( double x);


Description : The asin function computes the principal value of the arcsine of x. A domain error occurs for arguments not in the range [-1,1].


Returns : The asin function returns the arcsine in the range [-π/2, π/2). When the argument is the outside the permissible range, the matherr function is called. Unless the default mather function is replaced, it will set the global variable errno to EDOM, and print a "DOMAIN error" diagnostic message using the stderr stream.

 

See Also : acos, atan, atan2, matherr

Example :

#include <stdio.h> 

#include <math.h>


void main( )

{
    printf( "%f\n", asin(.5) );

}

 

produces the following :

0.523599


Classification : ANSI
Systems : All

 

 

 

asinh

 

Synopsis : #include <math.h> 

              double asinh( double x);

Description : The asinh function computes the inverse hyperbolic sine of x.


Returns : The asinh function returns the inverse hyperbolic sine value.

See Also : acosh, atanh, sinh, matherr

Example :

#include <stdio.h>
#include <math.h>


void main( )

{
    printf( "%f\n", asinh( 0.5) );

}

 

produces the following :

0.481212


Classification : WATCOM
Systems : All


 

 

assert

 

Synopsis : #include <assert.h> 

              void assert ( int expression );

Description : The assert macro prints a diagnostic message upon the stderr stream and terminates the program if expression is false (O). The diagnostic message has the form

 

Assertion failed: expression, file filename, line linenumber

 

where filename is the name of the source file and linenumber is the line number of the assertion that failed in the source file. Filename and linenumber are the values of the preprocessing macros __FILE__ and __LINE__ espectively. No action is taken if expression is true (non-zero).

 

The assert macro is typically used during program development to identify program 10g errors. The given expression should be chosen so that it is true when the program is functioning as intended. 

 

After the program has been debugged, the special "no debug" identifier NDEBUG can be used to remove assert calls from the program when it is re-compiled.

 

If NDEBUG is defined (with any value) with a -d command line option or with a #define directive, the C preprocessor ignores all assert calls in the program source.

 

 

Returns : The assert macro does not return a value.

Example :
#include <stdio.h> 

#include <assert.h>
void process string( char *string ) 

{
    /* use assert to check argument */

    assert ( string != NULL);

    assert ( *string != '\0' );

    /* rest of code follows here */

}

 

void main( )

{
    process_string( "hello" );

    process_string( "" );

}

 

Classification : ANSI
Systems : MACRO

 

 

 

atan

 

Synopsis : #include <math.h> 

              double atan( double x);

Description : The atan function computes the principal value of the arctangent of x.

Returns : The atan function returns the arctangent in the range (-π/2, π/2).

See Also : acos, asin, atan2 

Example :
#include <stdio.h> 

#include <math.h>


void main( ) 

{
    printf( "%f\n", atan(.5) );

}

 

produces the following :

0.463648

 

 

Classification : ANSI
Systems : All

 

 

 

 

atan2

 

Synopsis : #include <math.h> 

              double atan2 ( double y, double x);

Description : The atan2 function computes the principal value of the arctangent of y/x, using the signs of both arguments to determine the quadrant of the return value. A domain error occurs if arguments are zero.


Returns : The atan2 function returns the arctangent of y/x, in the range (-π, π). When the argumenti outside the permissible range, the matherr function is called. Unless the default mathem function is replaced, it will set the global variable errno to EDOM, and print a "DOMAIN error" diagnostic message using the stderr stream.

See Also : acos, asin, atan, matherr

Example :
#include <stdio.h> 

#include <math.h>


void main( ) 

{
    printf( "%f\n", atan2 ( .5, 1. ) );

}

 

produces the following :

0.463648


Classification : ANSI
Systems : All

 

 

 

atanh

 

Synopsis : #include <math.h> 

              double atanh( double x);

Description : The atanh function computes the inverse hyperbolic tangent of x. A domain error occurs if
the value of x is outside the range (-1, 1).


Returns : The atanh function returns the inverse hyperbolic tangent value. When the argument is outside the permissible range, the matherr function is called. Unless the default matherr function is replaced, it will set the global variable errno to EDOM, and print a "DOMAIN error" diagnostic message using the stderr stream.

See Also : acosh, asinh, matherr, tanh

Example :
#include <stdio.h> 

#include <math.h>


void main( )

{
    printf( "%f\n", atanh ( 0.5) );

}

 

produces the following :

0.549306


Classification : WATCOM
Systems : All

 

 

 

 

 

This manual describes the WATCOM C library for DOS, Windows, and OS/2, It includes the Standard C Library (as defined in the ANSI C Standard).

 

WATCOM C Language Reference manual describes the ANSI C Programming language and extensions to it which are supported by WATCOM C/C++ (32bit)

 

 

 

 

728x90
반응형
Posted by 전화카드
,