Exp.htm 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <html>
  2. <head>
  3. <title>Blitz3D Docs</title>
  4. <link rel=stylesheet href=../css/commands.css type=text/css>
  5. </head>
  6. <body>
  7. <h1>Exp# ( x# )</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. x = any number.
  13. </td>
  14. </tr>
  15. </table>
  16. <h1>Description</h1>
  17. <table>
  18. <tr>
  19. <td>
  20. This is e^x where e = 2.71828... <br />
  21. <br />
  22. For the curious, e is defined by the infinite sum: <br />
  23. <br />
  24. 2 + 1/(2) + 1/(2*3) + 1/(2*3*4) + 1/(2*3*4*5) + ... <br />
  25. <br />
  26. See also Log()
  27. </td>
  28. </tr>
  29. </table>
  30. <h1><a href=../2d_examples/Exp.bb>Example</a></h1>
  31. <table>
  32. <tr>
  33. <td>
  34. ; Exp example <br />
  35. <br />
  36. ; Exp(x) is the same as e^x. <br />
  37. <br />
  38. ; Actually, due to the approximate nature of floating point arithmetic <br />
  39. ; these will not be exactly equal. But in the following example <br />
  40. ; the difference is so small you can't see it. <br />
  41. <br />
  42. e# = 2.71828182845905 ; over-specified, might help and can't hurt. <br />
  43. <br />
  44. x# = .125 ; = 1/8 <br />
  45. <br />
  46. Print " x Exp(x) e^x " <br />
  47. Print "======= ========= =========" <br />
  48. <br />
  49. For k = 1 To 7 <br />
  50. <br />
  51. Write " " + LSet( x , 7 ) <br />
  52. Write RSet( Exp( x ), 10 ) <br />
  53. Print RSet( e^x , 12 ) <br />
  54. x = 2 * x <br />
  55. <br />
  56. Next <br />
  57. <br />
  58. WaitKey() : End
  59. </td>
  60. </tr>
  61. </table>
  62. <br>
  63. <a target=_top href=../index.htm>Index</a><br>
  64. <br>
  65. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=Exp&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  66. </html>