CONTENTS | INDEX | PREV | NEXT
cos
fcos
NAME
cos - return cosine of a double quantity
fcos - return cosine of a float quantity
SYNOPSIS
#include <math.h>
double a = cos(b);
double b;
float c = fcos(d);
float d;
FUNCTION
Returns the cosine of a floating point quantity
EXAMPLE
/*
* compile with the math library -lm
*/
#include <math.h>
#include <stdio.h>
main()
{
{
double a = cos(0.25);
printf("cos 0.25 = %lfn", a); /* 0.9689 */
}
{ /* less accuracy */
float a = fcos(0.25);
printf("cos 0.25 = %lfn", (double)a);
}
return(0);
}
INPUTS
double b; double floating point value
float d; float floating point value
RESULTS
double a; result double floating point value
float c; result float floating point value