1
0

frexp 869 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. .TH FREXP 2
  2. .SH NAME
  3. frexp, ldexp, modf \- split into mantissa and exponent
  4. .SH SYNOPSIS
  5. .B #include <u.h>
  6. .br
  7. .B #include <libc.h>
  8. .PP
  9. .B
  10. double frexp(double value, int *eptr)
  11. .PP
  12. .B
  13. double ldexp(double value, int exp)
  14. .PP
  15. .B
  16. double modf(double value, double *iptr)
  17. .SH DESCRIPTION
  18. .I Frexp
  19. returns the mantissa of
  20. .I value
  21. and stores the exponent indirectly through
  22. .IR eptr ,
  23. so that
  24. .I value
  25. =
  26. .if t .IR frexp ( value )×2\u\s-2 (*eptr) \s0\d
  27. .if n .IR frexp ( value )*2** (*eptr).
  28. .PP
  29. .I Ldexp
  30. returns the quantity
  31. .if t .IR value ×2\u\s-2 exp \s0\d.
  32. .if n .IR value *2** exp.
  33. .PP
  34. .I Modf
  35. returns the signed fractional part of
  36. .I value
  37. and stores the integer part indirectly
  38. through
  39. .IR iptr .
  40. .SH SOURCE
  41. .B /sys/src/libc/port/frexp.c
  42. .SH SEE ALSO
  43. .IR intro (2)
  44. .SH DIAGNOSTICS
  45. .I Ldexp
  46. returns 0 for underflow and the appropriately signed infinity
  47. for overflow.