Advertisement
Guest User

Untitled

a guest
Jun 9th, 2014
420
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. $ cat t.c
  2. #include <stdio.h>
  3. #include <math.h>
  4. #include <fenv.h>
  5.  
  6. int main(){
  7. printf("default:%.0f\n", 1.5);
  8. fesetround(FE_DOWNWARD);
  9. printf("down:%.0f\n", 1.5);
  10. fesetround(FE_UPWARD);
  11. printf("up:%.0f\n", 1.5);
  12. }
  13. $ gcc t.c && ./a.out
  14. default:2
  15. down:1
  16. up:2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement