floor 737 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. .TH FLOOR 2
  2. .SH NAME
  3. fabs, fmod, floor, ceil \- absolute value, remainder, floor, ceiling functions
  4. .SH SYNOPSIS
  5. .B #include <u.h>
  6. .br
  7. .B #include <libc.h>
  8. .PP
  9. .B
  10. double floor(double x)
  11. .PP
  12. .B
  13. double ceil(double x)
  14. .PP
  15. .B
  16. double fabs(double x)
  17. .PP
  18. .B
  19. double fmod(double x, double y)
  20. .SH DESCRIPTION
  21. .I Fabs
  22. returns the absolute value
  23. .RI | \|x\| |.
  24. .PP
  25. .I Floor
  26. returns the
  27. largest integer
  28. not greater than
  29. .IR x .
  30. .PP
  31. .I Ceil
  32. returns the
  33. smallest integer
  34. not less than
  35. .IR x .
  36. .PP
  37. .I Fmod
  38. returns
  39. .I x
  40. if
  41. .I y
  42. is zero, otherwise the number
  43. .I f
  44. with the same sign as
  45. .IR x ,
  46. such that
  47. .I "x = iy + f\|"
  48. for some integer
  49. .IR i ,
  50. and
  51. .RI | \|f\| |
  52. <
  53. .RI | \|y\| |.
  54. .SH SOURCE
  55. .B /sys/src/libc/port
  56. .SH SEE ALSO
  57. .IR abs (2),
  58. .IR frexp (2)