Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 ユーザーズマニュアル

製品コード
SW006021-1
ページ / 518
MPLAB
®
 XC8 C Compiler User’s Guide
DS52053B-page 320
 2012 Microchip Technology Inc.
Example
#include <math.h>
#include <stdio.h>
void 
main (void)
{
    float i, a;
    for(i = -1.0; i < 1.0 ; i += 0.1) {
        a = asin(i)*180.0/3.141592;
        printf(“asin(%f) = %f degrees\n”, i, a);
    }
}
See Also
sin()
, cos(), tan(), acos(), atan(), atan2()
Return Value
An angle in radians, in the range - 
ASSERT 
Synopsis
#include <assert.h>
 
void assert (int e)
Description
This macro is used for debugging purposes; the basic method of usage is to place 
assertions liberally throughout your code at points where correct operation of the code 
depends upon certain conditions being true initially. An 
assert()
 routine may be used 
to ensure at run time that an assumption holds true. For example, the following 
statement asserts that tp is not equal to NULL:
assert(tp);
If at run time the expression evaluates to false, the program will abort with a message 
identifying the source file and line number of the assertion, and the expression used as 
an argument to it. A fuller discussion of the uses of 
assert()
 is impossible in limited 
space, but it is closely linked to methods of proving program correctness.
The assert() macro depends on the implementation of the function _fassert(). 
By default this prints information using printf(). This routine should be inspected to 
ensure it meets your application needs. Include the source file containing this function, 
even if you do not modify it, into your project and then rebuild. The _fassert() 
function is not built into any library file.
Example
#include <assert.h>
void 
ptrfunc (struct xyz * tp)
{
    assert(tp != 0);
}
Note
The underlying routine _fassert(...) will need to be implemented by the user.