nan 937 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. .TH NAN 2
  2. .SH NAME
  3. NaN, Inf, isNaN, isInf \- not-a-number and infinity functions
  4. .SH SYNOPSIS
  5. .B #include <u.h>
  6. .br
  7. .B #include <libc.h>
  8. .PP
  9. .ta \w'\fLdouble 'u
  10. .B
  11. double NaN(void)
  12. .PP
  13. .B
  14. double Inf(int)
  15. .PP
  16. .B
  17. int isNaN(double)
  18. .PP
  19. .B
  20. int isInf(double, int)
  21. .SH DESCRIPTION
  22. The IEEE floating point standard defines values called
  23. `not-a-number' and positive and negative `infinity'.
  24. These values can be produced by such things as overflow
  25. and division by zero.
  26. Also, the library functions sometimes return them when
  27. the arguments are not in the domain, or the result is
  28. out of range.
  29. .PP
  30. .I NaN
  31. returns a double that is not-a-number.
  32. .I IsNaN
  33. returns true if its argument is not-a-number.
  34. .PP
  35. .IR Inf ( i )
  36. returns positive infinity if
  37. .I i
  38. is greater than or equal to zero,
  39. else negative infinity.
  40. .I IsInf
  41. returns true if its first argument is infinity
  42. with the same sign as the second argument.
  43. .SH SOURCE
  44. .B /sys/src/libc/port/nan.c