1
0

exp 935 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. .TH EXP 2
  2. .SH NAME
  3. exp, log, log10, pow, pow10, sqrt \- exponential, logarithm, power, square root
  4. .SH SYNOPSIS
  5. .B #include <u.h>
  6. .br
  7. .B #include <libc.h>
  8. .PP
  9. .nf
  10. .B
  11. double exp(double x)
  12. .PP
  13. .B
  14. double log(double x)
  15. .PP
  16. .B
  17. double log10(double x)
  18. .PP
  19. .B
  20. double pow(double x, double y)
  21. .PP
  22. .B
  23. double pow10(int n)
  24. .PP
  25. .B
  26. double sqrt(double x)
  27. .fi
  28. .SH DESCRIPTION
  29. .I Exp
  30. returns the exponential function of
  31. .IR x .
  32. .PP
  33. .I Log
  34. returns the natural logarithm of
  35. .IR x ;
  36. .I log10
  37. returns the base 10 logarithm.
  38. .PP
  39. .I Pow
  40. returns
  41. .if t .I x\u\s8y\s10\d
  42. .if n x^y,
  43. and
  44. .I pow10
  45. returns
  46. .if t .I 10\u\s8n\s10\d
  47. .if n 10^n
  48. as a double.
  49. .PP
  50. .I Sqrt
  51. returns the square root of
  52. .IR x .
  53. .SH SOURCE
  54. All these routines have portable C implementations in
  55. .BR /sys/src/libc/port .
  56. Most also have machine-dependent implementations, written either in assembler
  57. or C, in
  58. .BR /sys/src/libc/$objtype .
  59. .SH SEE ALSO
  60. .IR hypot (2),
  61. .IR sinh (2),
  62. .IR intro (2)