uni

University stuff
git clone git://git.margiolis.net/uni.git
Log | Files | Refs | README | LICENSE

main.c (547B)


      1 #include <stdio.h>
      2 #include <math.h>
      3 #include "sine-cos-taylor.h"
      4 
      5 
      6 int main(int argc, char **argv)
      7 {
      8     double xDegrees, xRads;
      9 
     10     xDegrees = input();
     11 
     12     xRads = rads_conv(xDegrees);
     13 
     14     if (compare(sine_calc(xRads), sin(xRads)))
     15         printf("sin(%f) = sin(%f) = %f rads\n", xDegrees, xRads, sine_calc(xRads));
     16     else
     17         printf("Error.\n");
     18 
     19     if (compare(cosine_calc(xRads), cos(xRads)))
     20         printf("cos(%f) = cos(%f) = %f rads\n", xDegrees, xRads, cosine_calc(xRads));
     21     else
     22         printf("Error.\n");
     23 
     24     return 0;
     25 }