Advertisement
MichaelPetch

SO 78391454

Apr 26th, 2024 (edited)
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #include <math.h>
  2. #include <stdio.h>
  3.  
  4. double x87_sin (double x)
  5. {
  6. double sinval;
  7.  
  8. asm ("fsin" : "=t" (sinval) : "0" (x));
  9. return sinval;
  10. }
  11.  
  12. int main(void)
  13. {
  14. double x = 45.0*M_PI/180.0;
  15. printf ("%f\n", x87_sin(x));
  16. return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement