math.xml 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198
  1. <?xml version="1.0" encoding="ISO8859-1"?>
  2. <fpdoc-descriptions>
  3. <!--
  4. $Id$
  5. This file is part of the FPC documentation.
  6. Copyright (C) 1997, by Michael Van Canneyt
  7. The FPC documentation is free text; you can redistribute it and/or
  8. modify it under the terms of the GNU Library General Public License as
  9. published by the Free Software Foundation; either version 2 of the
  10. License, or (at your option) any later version.
  11. The FPC Documentation is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. Library General Public License for more details.
  15. You should have received a copy of the GNU Library General Public
  16. License along with the FPC documentation; see the file COPYING.LIB. If not,
  17. write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  18. Boston, MA 02111-1307, USA.
  19. -->
  20. <package name="rtl">
  21. <module name="math">
  22. <short>Additional mathematical routines.</short>
  23. <!-- \FPCexampledir{mathex} -->
  24. <descr>
  25. <p>
  26. This document describes the <file>math</file> unit. The <var>math</var> unit
  27. was initially written by Florian Klaempfl. It provides mathematical
  28. functions which aren't covered by the system unit.
  29. </p>
  30. <p>
  31. This chapter starts out with a definition of all types and constants
  32. that are defined, after which an overview is presented of the available
  33. functions, grouped by category, and the last part contains a
  34. complete explanation of each function.
  35. </p>
  36. <p>
  37. The following things must be taken into account when using this unit:
  38. </p>
  39. <ol>
  40. <li>This unit is compiled in Object Pascal mode so all <var>integers</var> are 32 bit.</li>
  41. <li> Some overloaded functions exist for data arrays of integers and
  42. floats. When using the address operator (<var>@</var>) to pass an array of
  43. data to such a function, make sure the address is typecasted to the
  44. right type, or turn on the 'typed address operator' feature. failing to
  45. do so, will cause the compiler not be able to decide which function you
  46. want to call.
  47. </li>
  48. </ol>
  49. </descr>
  50. <topic name="MinMaxRoutines">
  51. <short>Min/max determination</short>
  52. <descr>
  53. <p>
  54. Functions to determine the minimum or maximum of numbers:
  55. </p>
  56. <table>
  57. <th><td>Name</td><td>Description</td></th>
  58. <tr><td><link id="max"/></td><td>Maximum of 2 values</td></tr>
  59. <tr><td><link id="maxIntValue"/></td><td>Maximum of an array of integer values</td></tr>
  60. <tr><td><link id="maxvalue"/></td><td>Maximum of an array of values</td></tr>
  61. <tr><td><link id="min"/></td><td>Minimum of 2 values</td></tr>
  62. <tr><td><link id="minIntValue"/></td><td>Minimum of an array of integer values</td></tr>
  63. <tr><td><link id="minvalue"/></td><td>Minimum of an array of values</td></tr>
  64. </table>
  65. </descr>
  66. </topic>
  67. <topic name="AngleConversionRoutines">
  68. <short>Angle unit conversion</short>
  69. <descr>
  70. <p>
  71. Routines to convert angles between different angle units.
  72. </p>
  73. <table>
  74. <th><td>Name</td><td>Description</td></th>
  75. <tr><td><link id="cycletorad"/></td><td>convert cycles to radians</td></tr>
  76. <tr><td><link id="degtograd"/></td><td>convert degrees to grads</td></tr>
  77. <tr><td><link id="degtorad"/></td><td>convert degrees to radians</td></tr>
  78. <tr><td><link id="gradtodeg"/></td><td>convert grads to degrees</td></tr>
  79. <tr><td><link id="gradtorad"/></td><td>convert grads to radians</td></tr>
  80. <tr><td><link id="radtocycle"/></td><td>convert radians to cycles</td></tr>
  81. <tr><td><link id="radtodeg"/></td><td>convert radians to degrees</td></tr>
  82. <tr><td><link id="radtograd"/></td><td>convert radians to grads</td></tr>
  83. </table>
  84. </descr>
  85. </topic>
  86. <topic name="TrigoniometricRoutines">
  87. <short>Trigoniometric functions</short>
  88. <descr>
  89. <table>
  90. <th><td>Name</td><td>Description</td></th>
  91. <tr><td><link id="arccos"/></td><td>calculate reverse cosine</td></tr>
  92. <tr><td><link id="arcsin"/></td><td>calculate reverse sine</td></tr>
  93. <tr><td><link id="arctan2"/></td><td>calculate reverse tangent</td></tr>
  94. <tr><td><link id="cotan"/></td><td>calculate cotangent</td></tr>
  95. <tr><td><link id="sincos"/></td><td>calculate sine and cosine</td></tr>
  96. <tr><td><link id="tan"/></td><td>calculate tangent</td></tr>
  97. </table>
  98. </descr>
  99. </topic>
  100. <topic name="HyperbolicRoutines">
  101. <short>Hyperbolic functions</short>
  102. <descr>
  103. <table>
  104. <th><td>Name</td><td>Description</td></th>
  105. <tr><td><link id="arcosh"/></td><td>caculate reverse hyperbolic cosine</td></tr>
  106. <tr><td><link id="arsinh"/></td><td>caculate reverse hyperbolic sine</td></tr>
  107. <tr><td><link id="artanh"/></td><td>caculate reverse hyperbolic tangent</td></tr>
  108. <tr><td><link id="cosh"/></td><td>calculate hyperbolic cosine</td></tr>
  109. <tr><td><link id="sinh"/></td><td>calculate hyperbolic sine</td></tr>
  110. <tr><td><link id="tanh"/></td><td>calculate hyperbolic tangent</td></tr>
  111. </table>
  112. </descr>
  113. </topic>
  114. <topic name="ExpLogRoutines">
  115. <short>Exponential and logarithmic functions</short>
  116. <descr>
  117. <table>
  118. <th><td>Name</td><td>Description</td></th>
  119. <tr><td><link id="intpower"/></td><td>Raise float to integer power</td></tr>
  120. <tr><td><link id="ldexp"/></td><td>Calculate $2^p x$</td></tr>
  121. <tr><td><link id="lnxp1"/></td><td>calculate <var>log(x+1)</var></td></tr>
  122. <tr><td><link id="log10"/></td><td>calculate 10-base log</td></tr>
  123. <tr><td><link id="log2"/></td><td>calculate 2-base log</td></tr>
  124. <tr><td><link id="logn"/></td><td>calculate N-base log</td></tr>
  125. <tr><td><link id="power"/></td><td>raise float to arbitrary power</td></tr>
  126. </table>
  127. </descr>
  128. </topic>
  129. <topic name="NumberConversionRoutines">
  130. <short>Number converting</short>
  131. <descr>
  132. <table>
  133. <th><td>Name</td><td>Description</td></th>
  134. <tr><td><link id="ceil"/></td><td>Round to infinity</td></tr>
  135. <tr><td><link id="floor"/></td><td>Round to minus infinity</td></tr>
  136. <tr><td><link id="frexp"/></td><td>Return mantissa and exponent</td></tr>
  137. </table>
  138. </descr>
  139. </topic>
  140. <topic name="StatisticalRoutines">
  141. <short>Statistical functions</short>
  142. <descr>
  143. <table>
  144. <th><td>Name</td><td>Description</td></th>
  145. <tr><td><link id="mean"/></td><td>Mean of values</td></tr>
  146. <tr><td><link id="meanandstddev"/></td><td>Mean and standard deviation of values</td></tr>
  147. <tr><td><link id="momentskewkurtosis"/></td><td>Moments, skew and kurtosis</td></tr>
  148. <tr><td><link id="popnstddev"/></td><td>Population standarddeviation </td></tr>
  149. <tr><td><link id="popnvariance"/></td><td>Population variance</td></tr>
  150. <tr><td><link id="randg"/></td><td>Gaussian distributed randum value</td></tr>
  151. <tr><td><link id="stddev"/></td><td>Standard deviation</td></tr>
  152. <tr><td><link id="sum"/></td><td>Sum of values</td></tr>
  153. <tr><td><link id="sumofsquares"/></td><td>Sum of squared values</td></tr>
  154. <tr><td><link id="sumsandsquares"/></td><td>Sum of values and squared values</td></tr>
  155. <tr><td><link id="totalvariance"/></td><td>Total variance of values</td></tr>
  156. <tr><td><link id="variance"/></td><td>variance of values</td></tr>
  157. </table>
  158. </descr>
  159. </topic>
  160. <topic name="GeometricalRoutines">
  161. <short>Geometrical functions</short>
  162. <descr>
  163. <table>
  164. <th><td>Name</td><td>Description</td></th>
  165. <tr><td><link id="hypot"/></td><td>Hypotenuse of triangle</td></tr>
  166. <tr><td><link id="norm"/></td><td>Euclidian norm</td></tr>
  167. </table>
  168. </descr>
  169. </topic>
  170. <element name="Float">
  171. <short>Float type used in all calls</short>
  172. <descr>
  173. All calculations are done with the Float type. This allows to
  174. recompile the unit with a different float type to obtain a
  175. desired precision. The pointer type <link id="PFloat"/>
  176. is used in functions that accept an array of values of arbitrary length.
  177. </descr>
  178. </element>
  179. <element name="PFloat">
  180. <short>Pointer to <link id="Float"/> type.</short>
  181. </element>
  182. <element name="TPaymentTime">
  183. <short>Type used in financial (interest) calculations.</short>
  184. </element>
  185. <element name="TPaymentTime.PTEndOfPeriod">
  186. <short>End of period.</short>
  187. </element>
  188. <element name="TPaymentTime.PTStartOfPeriod">
  189. <short>Start of period.</short>
  190. </element>
  191. <element name="EInvalidArgument">
  192. <short>Exception raised when invalid arguments are passed to a function.</short>
  193. </element>
  194. <element name="arccos">
  195. <short></short>
  196. <descr>
  197. <var>Arccos</var> returns the inverse cosine of its argument <var>x</var>. The
  198. argument <var>x</var> should lie between -1 and 1 (borders included).
  199. </descr>
  200. <errors>
  201. If the argument <var>x</var> is not in the allowed range, an
  202. <var>EInvalidArgument</var> exception is raised.
  203. </errors>
  204. <seealso>
  205. <link id="arcsin"/>
  206. <link id="arcosh"/>
  207. <link id="arsinh"/>
  208. <link id="artanh"/>
  209. </seealso>
  210. <example file="mathex/ex1"/>
  211. </element>
  212. <element name="arcosh">
  213. <short></short>
  214. <descr>
  215. <var>Arcosh</var> returns the inverse hyperbolic cosine of its argument <var>x</var>.
  216. The argument <var>x</var> should be larger than 1.
  217. The <var>arccosh</var> variant of this function is supplied for Delphi
  218. compatibility.
  219. </descr>
  220. <errors>
  221. If the argument <var>x</var> is not in the allowed range, an <var>EInvalidArgument</var>
  222. exception is raised.
  223. </errors>
  224. <seealso>
  225. <link id="cosh"/>
  226. <link id="sinh"/>
  227. <link id="arcsin"/>
  228. <link id="arsinh"/>
  229. <link id="artanh"/>,
  230. <link id="tanh"/>
  231. </seealso>
  232. <example file="mathex/ex3"/>
  233. </element>
  234. <element name="arcsin">
  235. <short></short>
  236. <descr>
  237. <var>Arcsin</var> returns the inverse sine of its argument <var>x</var>. The
  238. argument <var>x</var> should lie between -1 and 1.
  239. </descr>
  240. <errors>
  241. If the argument <var>x</var> is not in the allowed range, an <var>EInvalidArgument</var>
  242. exception is raised.
  243. </errors>
  244. <seealso>
  245. <link id="arccos"/>
  246. <link id="arcosh"/>
  247. <link id="arsinh"/>
  248. <link id="artanh"/>
  249. </seealso>
  250. <example file="mathex/ex2"/>
  251. </element>
  252. <element name="arctan2">
  253. <short></short>
  254. <descr>
  255. <var>arctan2</var> calculates <var>arctan(y/x)</var>, and returns an angle in the
  256. correct quadrant. The returned angle will be in the range $-\pi$ to
  257. $\pi$ radians.
  258. The values of <var>x</var> and <var>y</var> must be between -2\^{}64 and 2\^{}64,
  259. moreover <var>x</var> should be different from zero.
  260. On Intel systems this function is implemented with the native intel
  261. <var>fpatan</var> instruction.
  262. </descr>
  263. <errors>
  264. If <var>x</var> is zero, an overflow error will occur.
  265. </errors>
  266. <seealso>
  267. <link id="arccos"/>
  268. <link id="arcosh"/>
  269. <link id="arsinh"/>
  270. <link id="artanh"/>
  271. </seealso>
  272. <example file="mathex/ex6"/>
  273. </element>
  274. <element name="arsinh">
  275. <short></short>
  276. <descr>
  277. <var>arsinh</var> returns the inverse hyperbolic sine of its argument <var>x</var>.
  278. The <var>arscsinh</var> variant of this function is supplied for Delphi
  279. compatibility.
  280. </descr>
  281. <errors>
  282. None.
  283. </errors>
  284. <seealso>
  285. <link id="arcosh"/>
  286. <link id="arccos"/>
  287. <link id="arcsin"/>
  288. <link id="artanh"/>
  289. </seealso>
  290. <example file="mathex/ex4"/>
  291. </element>
  292. <element name="artanh">
  293. <short></short>
  294. <descr>
  295. <var>artanh</var> returns the inverse hyperbolic tangent of its argument <var>x</var>,
  296. where <var>x</var> should lie in the interval [-1,1], borders included.
  297. The <var>arctanh</var> variant of this function is supplied for Delphi compatibility.
  298. </descr>
  299. <errors>
  300. In case <var>x</var> is not in the interval [-1,1], an <var>EInvalidArgument</var>
  301. exception is raised.
  302. </errors>
  303. <seealso>
  304. <link id="arcosh"/>
  305. <link id="arccos"/>
  306. <link id="arcsin"/>
  307. <link id="artanh"/>
  308. </seealso>
  309. <example file="mathex/ex5"/>
  310. </element>
  311. <element name="ceil">
  312. <short></short>
  313. <descr>
  314. <var>Ceil</var> returns the lowest integer number greater than or equal to <var>x</var>.
  315. The absolute value of <var>x</var> should be less than <var>maxint</var>.
  316. </descr>
  317. <errors>
  318. If the asolute value of <var>x</var> is larger than maxint, an overflow error will
  319. occur.
  320. </errors>
  321. <seealso>
  322. <link id="floor"/>
  323. </seealso>
  324. <example file="mathex/ex7"/>
  325. </element>
  326. <element name="cosh">
  327. <short></short>
  328. <descr>
  329. <var>Cosh</var> returns the hyperbolic cosine of it's argument {x}.
  330. </descr>
  331. <errors>
  332. None.
  333. </errors>
  334. <seealso>
  335. <link id="arcosh"/>
  336. <link id="sinh"/>
  337. <link id="arsinh"/>
  338. </seealso>
  339. <example file="mathex/ex8"/>
  340. </element>
  341. <element name="cotan">
  342. <short></short>
  343. <descr>
  344. <var>Cotan</var> returns the cotangent of it's argument <var>x</var>. <var>x</var> should
  345. be different from zero.
  346. </descr>
  347. <errors>
  348. If <var>x</var> is zero then a overflow error will occur.
  349. </errors>
  350. <seealso>
  351. <link id="tanh"/>
  352. </seealso>
  353. <example file="mathex/ex9"/>
  354. </element>
  355. <element name="cycletorad">
  356. <short></short>
  357. <descr>
  358. <var>Cycletorad</var> transforms it's argument <var>cycle</var>
  359. (an angle expressed in cycles) to radians.
  360. (1 cycle is $2 \pi$ radians).
  361. </descr>
  362. <errors>
  363. None.
  364. </errors>
  365. <seealso>
  366. <link id="degtograd"/>
  367. <link id="degtorad"/>
  368. <link id="radtodeg"/>,
  369. <link id="radtograd"/>
  370. <link id="radtocycle"/>
  371. </seealso>
  372. <example file="mathex/ex10"/>
  373. </element>
  374. <element name="degtograd">
  375. <short></short>
  376. <descr>
  377. <var>Degtograd</var> transforms it's argument <var>deg</var> (an angle in degrees)
  378. to grads.
  379. (90 degrees is 100 grad.)
  380. </descr>
  381. <errors>
  382. None.
  383. </errors>
  384. <seealso>
  385. <link id="cycletorad"/>
  386. <link id="degtorad"/>
  387. <link id="radtodeg"/>,
  388. <link id="radtograd"/>
  389. <link id="radtocycle"/>
  390. </seealso>
  391. <example file="mathex/ex11"/>
  392. </element>
  393. <element name="degtorad">
  394. <short></short>
  395. <descr>
  396. <var>Degtorad</var> converts it's argument <var>deg</var> (an angle in degrees) to
  397. radians.
  398. (pi radians is 180 degrees)
  399. </descr>
  400. <errors>
  401. None.
  402. </errors>
  403. <seealso>
  404. <link id="cycletorad"/>
  405. <link id="degtograd"/>
  406. <link id="radtodeg"/>,
  407. <link id="radtograd"/>
  408. <link id="radtocycle"/>
  409. </seealso>
  410. <example file="mathex/ex12"/>
  411. </element>
  412. <element name="floor">
  413. <short></short>
  414. <descr>
  415. <var>Floor</var> returns the largest integer smaller than or equal to <var>x</var>.
  416. The absolute value of <var>x</var> should be less than <var>maxint</var>.
  417. </descr>
  418. <errors>
  419. If <var>x</var> is larger than <var>maxint</var>, an overflow will occur.
  420. </errors>
  421. <seealso>
  422. <link id="ceil"/>
  423. </seealso>
  424. <example file="mathex/ex13"/>
  425. </element>
  426. <element name="frexp">
  427. <short></short>
  428. <descr>
  429. <var>Frexp</var> returns the mantissa and exponent of it's argument
  430. <var>x</var> in <var>mantissa</var> and <var>exponent</var>.
  431. </descr>
  432. <errors>
  433. None
  434. </errors>
  435. <seealso>
  436. </seealso>
  437. <example file="mathex/ex14"/>
  438. </element>
  439. <element name="gradtodeg">
  440. <short></short>
  441. <descr>
  442. <var>Gradtodeg</var> converts its argument <var>grad</var> (an angle in grads)
  443. to degrees.
  444. (100 grad is 90 degrees)
  445. </descr>
  446. <errors>
  447. None.
  448. </errors>
  449. <seealso>
  450. <link id="cycletorad"/>
  451. <link id="degtograd"/>
  452. <link id="radtodeg"/>,
  453. <link id="radtograd"/>
  454. <link id="radtocycle"/>
  455. <link id="gradtorad"/>
  456. </seealso>
  457. <example file="mathex/ex15"/>
  458. </element>
  459. <element name="gradtorad">
  460. <short></short>
  461. <descr>
  462. <var>Gradtorad</var> converts its argument <var>grad</var> (an angle in grads)
  463. to radians.
  464. (200 grad is pi degrees).
  465. </descr>
  466. <errors>
  467. None.
  468. </errors>
  469. <seealso>
  470. <link id="cycletorad"/>
  471. <link id="degtograd"/>
  472. <link id="radtodeg"/>,
  473. <link id="radtograd"/>
  474. <link id="radtocycle"/>
  475. <link id="gradtodeg"/>
  476. </seealso>
  477. <example file="mathex/ex16"/>
  478. </element>
  479. <element name="hypot">
  480. <short></short>
  481. <descr>
  482. <var>Hypot</var> returns the hypotenuse of the triangle where the sides
  483. adjacent to the square angle have lengths <var>x</var> and <var>y</var>.
  484. The function uses Pythagoras' rule for this.
  485. </descr>
  486. <errors>
  487. None.
  488. </errors>
  489. <seealso>
  490. </seealso>
  491. <example file="mathex/ex17"/>
  492. </element>
  493. <element name="intpower">
  494. <short></short>
  495. <descr>
  496. <var>Intpower</var> returns <var>base</var> to the power <var>exponent</var>,
  497. where exponent is an integer value.
  498. </descr>
  499. <errors>
  500. If <var>base</var> is zero and the exponent is negative, then an
  501. overflow error will occur.
  502. </errors>
  503. <seealso>
  504. <link id="power"/>
  505. </seealso>
  506. <example file="mathex/ex18"/>
  507. </element>
  508. <element name="ldexp">
  509. <short></short>
  510. <descr>
  511. <var>Ldexp</var> returns $2^p x$.
  512. </descr>
  513. <errors>
  514. None.
  515. </errors>
  516. <seealso>
  517. <link id="lnxp1"/>
  518. <link id="log10"/>
  519. <link id="log2"/>
  520. <link id="logn"/>
  521. </seealso>
  522. <example file="mathex/ex19"/>
  523. </element>
  524. <element name="lnxp1">
  525. <short></short>
  526. <descr>
  527. <var>Lnxp1</var> returns the natural logarithm of <var>1+X</var>. The result
  528. is more precise for small values of <var>x</var>. <var>x</var> should be larger
  529. than -1.
  530. </descr>
  531. <errors>
  532. If $x\leq -1$ then an <var>EInvalidArgument</var> exception will be raised.
  533. </errors>
  534. <seealso>
  535. <link id="ldexp"/>
  536. <link id="log10"/>
  537. <link id="log2"/>
  538. <link id="logn"/>
  539. </seealso>
  540. <example file="mathex/ex20"/>
  541. </element>
  542. <element name="log10">
  543. <short></short>
  544. <descr>
  545. <var>Log10</var> returns the 10-base logarithm of <var>X</var>.
  546. </descr>
  547. <errors>
  548. If <var>x</var> is less than or equal to 0 an 'invalid fpu operation' error
  549. will occur.
  550. </errors>
  551. <seealso>
  552. <link id="ldexp"/>
  553. <link id="lnxp1"/>
  554. <link id="log2"/>
  555. <link id="logn"/>
  556. </seealso>
  557. <example file="mathex/ex21"/>
  558. </element>
  559. <element name="log2">
  560. <short></short>
  561. <descr>
  562. <var>Log2</var> returns the 2-base logarithm of <var>X</var>.
  563. </descr>
  564. <errors>
  565. If <var>x</var> is less than or equal to 0 an 'invalid fpu operation' error
  566. will occur.
  567. </errors>
  568. <seealso>
  569. <link id="ldexp"/>
  570. <link id="lnxp1"/>
  571. <link id="log10"/>
  572. <link id="logn"/>
  573. </seealso>
  574. <example file="mathex/ex22"/>
  575. </element>
  576. <element name="logn">
  577. <short></short>
  578. <descr>
  579. <var>Logn</var> returns the n-base logarithm of <var>X</var>.
  580. </descr>
  581. <errors>
  582. If <var>x</var> is less than or equal to 0 an 'invalid fpu operation' error
  583. will occur.
  584. </errors>
  585. <seealso>
  586. <link id="ldexp"/>
  587. <link id="lnxp1"/>
  588. <link id="log10"/>
  589. <link id="log2"/>
  590. </seealso>
  591. <example file="mathex/ex23"/>
  592. </element>
  593. <element name="max">
  594. <short></short>
  595. <descr>
  596. <var>Max</var> returns the maximum of <var>Int1</var> and <var>Int2</var>.
  597. </descr>
  598. <errors>
  599. None.
  600. </errors>
  601. <seealso>
  602. <link id="min"/>
  603. <link id="maxIntValue"/>
  604. <link id="maxvalue"/>
  605. </seealso>
  606. <example file="mathex/ex24"/>
  607. </element>
  608. <element name="maxIntValue">
  609. <short></short>
  610. <descr>
  611. <var>MaxIntValue</var> returns the largest integer out of the <var>Data</var>
  612. array.
  613. This function is provided for Delphi compatibility, use the <link id="maxvalue"/>
  614. function instead.
  615. </descr>
  616. <errors>
  617. None.
  618. </errors>
  619. <seealso>
  620. <link id="maxvalue"/>
  621. <link id="minvalue"/>
  622. <link id="minIntValue"/>
  623. </seealso>
  624. <example file="mathex/ex25"/>
  625. </element>
  626. <element name="maxvalue">
  627. <short></short>
  628. <descr>
  629. <var>Maxvalue</var> returns the largest value in the <var>data</var>
  630. array with integer or float values. The return value has
  631. the same type as the elements of the array.
  632. The third and fourth forms accept a pointer to an array of <var>N</var>
  633. integer or float values.
  634. </descr>
  635. <errors>
  636. None.
  637. </errors>
  638. <seealso>
  639. <link id="maxIntValue"/>
  640. <link id="minvalue"/>
  641. <link id="minIntValue"/>
  642. </seealso>
  643. <example file="mathex/ex26"/>
  644. </element>
  645. <element name="mean">
  646. <short></short>
  647. <descr>
  648. <var>Mean</var> returns the average value of <var>data</var>.
  649. The second form accepts a pointer to an array of <var>N</var> values.
  650. </descr>
  651. <errors>
  652. None.
  653. </errors>
  654. <seealso>
  655. <link id="meanandstddev"/>
  656. <link id="momentskewkurtosis"/>
  657. <link id="sum"/>
  658. </seealso>
  659. <example file="mathex/ex27"/>
  660. </element>
  661. <element name="meanandstddev">
  662. <short></short>
  663. <descr>
  664. <var>meanandstddev</var> calculates the mean and standard deviation of <var>data</var>
  665. and returns the result in <var>mean</var> and <var>stddev</var>, respectively.
  666. Stddev is zero if there is only one value.
  667. The second form accepts a pointer to an array of <var>N</var> values.
  668. </descr>
  669. <errors>
  670. None.
  671. </errors>
  672. <seealso>
  673. <link id="mean"/>
  674. <link id="sum"/>
  675. <link id="sumofsquares"/>
  676. <link id="momentskewkurtosis"/>
  677. </seealso>
  678. <example file="mathex/ex28"/>
  679. </element>
  680. <element name="min">
  681. <short></short>
  682. <descr>
  683. <var>min</var> returns the smallest value of <var>Int1</var> and <var>Int2</var>;
  684. </descr>
  685. <errors>
  686. None.
  687. </errors>
  688. <seealso>
  689. <link id="max"/>
  690. </seealso>
  691. <example file="mathex/ex29"/>
  692. </element>
  693. <element name="minIntValue">
  694. <short></short>
  695. <descr>
  696. <var>MinIntvalue</var> returns the smallest value in the <var>Data</var> array.
  697. This function is provided for Delphi compatibility, use <var>minvalue</var>
  698. instead.
  699. </descr>
  700. <errors>
  701. None
  702. </errors>
  703. <seealso>
  704. <link id="minvalue"/>
  705. <link id="maxIntValue"/>
  706. <link id="maxvalue"/>
  707. </seealso>
  708. <example file="mathex/ex30"/>
  709. </element>
  710. <element name="minvalue">
  711. <short></short>
  712. <descr>
  713. <var>Minvalue</var> returns the smallest value in the <var>data</var>
  714. array with integer or float values. The return value has
  715. the same type as the elements of the array.
  716. The third and fourth forms accept a pointer to an array of <var>N</var>
  717. integer or float values.
  718. </descr>
  719. <errors>
  720. None.
  721. </errors>
  722. <seealso>
  723. <link id="maxIntValue"/>
  724. <link id="maxvalue"/>
  725. <link id="minIntValue"/>
  726. </seealso>
  727. <example file="mathex/ex31"/>
  728. </element>
  729. <element name="momentskewkurtosis">
  730. <short></short>
  731. <descr>
  732. <var>momentskewkurtosis</var> calculates the 4 first moments of the distribution
  733. of valuesin <var>data</var> and returns them in <var>m1</var>,<var>m2</var>,<var>m3</var> and
  734. <var>m4</var>, as well as the <var>skew</var> and <var>kurtosis</var>.
  735. </descr>
  736. <errors>
  737. None.
  738. </errors>
  739. <seealso>
  740. <link id="mean"/>
  741. <link id="meanandstddev"/>
  742. </seealso>
  743. <example file="mathex/ex32"/>
  744. </element>
  745. <element name="norm">
  746. <short></short>
  747. <descr>
  748. <var>Norm</var> calculates the Euclidian norm of the array of data.
  749. This equals <var>sqrt(sumofsquares(data))</var>.
  750. The second form accepts a pointer to an array of <var>N</var> values.
  751. </descr>
  752. <errors>
  753. None.
  754. </errors>
  755. <seealso>
  756. <link id="sumofsquares"/>
  757. </seealso>
  758. <example file="mathex/ex33"/>
  759. </element>
  760. <element name="popnstddev">
  761. <short></short>
  762. <descr>
  763. <var>Popnstddev</var> returns the square root of the population variance of
  764. the values in the <var>Data</var> array. It returns zero if there is only one value.
  765. The second form of this function accepts a pointer to an array of <var>N</var>
  766. values.
  767. </descr>
  768. <errors>
  769. None.
  770. </errors>
  771. <seealso>
  772. <link id="popnvariance"/>
  773. <link id="mean"/>
  774. <link id="meanandstddev"/>
  775. <link id="stddev"/>,
  776. <link id="momentskewkurtosis"/>
  777. </seealso>
  778. <example file="mathex/ex35"/>
  779. </element>
  780. <element name="popnvariance">
  781. <short></short>
  782. <descr>
  783. <var>Popnvariance</var> returns the square root of the population variance of
  784. the values in the <var>Data</var> array. It returns zero if there is only one value.
  785. The second form of this function accepts a pointer to an array of <var>N</var>
  786. values.
  787. </descr>
  788. <errors>
  789. None.
  790. </errors>
  791. <seealso>
  792. <link id="popnstddev"/>
  793. <link id="mean"/>
  794. <link id="meanandstddev"/>
  795. <link id="stddev"/>,
  796. <link id="momentskewkurtosis"/>
  797. </seealso>
  798. <example file="mathex/ex36"/>
  799. </element>
  800. <element name="power">
  801. <short></short>
  802. <descr>
  803. <var>power</var> raises <var>base</var> to the power <var>power</var>. This is equivalent
  804. to <var>exp(power*ln(base))</var>. Therefore <var>base</var> should be non-negative.
  805. </descr>
  806. <errors>
  807. None.
  808. </errors>
  809. <seealso>
  810. <link id="intpower"/>
  811. </seealso>
  812. <example file="mathex/ex34"/>
  813. </element>
  814. <element name="radtocycle">
  815. <short></short>
  816. <descr>
  817. <var>Radtocycle</var> converts its argument <var>rad</var> (an angle expressed in
  818. radians) to an angle in cycles.
  819. (1 cycle equals 2 pi radians)
  820. </descr>
  821. <errors>
  822. None.
  823. </errors>
  824. <seealso>
  825. <link id="degtograd"/>
  826. <link id="degtorad"/>
  827. <link id="radtodeg"/>,
  828. <link id="radtograd"/>
  829. <link id="cycletorad"/>
  830. </seealso>
  831. <example file="mathex/ex37"/>
  832. </element>
  833. <element name="radtodeg">
  834. <short></short>
  835. <descr>
  836. <var>Radtodeg</var> converts its argument <var>rad</var> (an angle expressed in
  837. radians) to an angle in degrees.
  838. (180 degrees equals pi radians)
  839. </descr>
  840. <errors>
  841. None.
  842. </errors>
  843. <seealso>
  844. <link id="degtograd"/>
  845. <link id="degtorad"/>
  846. <link id="radtocycle"/>,
  847. <link id="radtograd"/>
  848. <link id="cycletorad"/>
  849. </seealso>
  850. <example file="mathex/ex38"/>
  851. </element>
  852. <element name="radtograd">
  853. <short></short>
  854. <descr>
  855. <var>Radtodeg</var> converts its argument <var>rad</var> (an angle expressed in
  856. radians) to an angle in grads.
  857. (200 grads equals pi radians)
  858. </descr>
  859. <errors>
  860. None.
  861. </errors>
  862. <seealso>
  863. <link id="degtograd"/>
  864. <link id="degtorad"/>
  865. <link id="radtocycle"/>,
  866. <link id="radtodeg"/>
  867. <link id="cycletorad"/>
  868. </seealso>
  869. <example file="mathex/ex39"/>
  870. </element>
  871. <element name="randg">
  872. <short></short>
  873. <descr>
  874. <var>randg</var> returns a random number which - when produced in large
  875. quantities - has a Gaussian distribution with mean <var>mean</var> and
  876. standarddeviation <var>stddev</var>.
  877. </descr>
  878. <errors>
  879. None.
  880. </errors>
  881. <seealso>
  882. <link id="mean"/>
  883. <link id="stddev"/>
  884. <link id="meanandstddev"/>
  885. </seealso>
  886. <example file="mathex/ex40"/>
  887. </element>
  888. <element name="sincos">
  889. <short></short>
  890. <descr>
  891. <var>Sincos</var> calculates the sine and cosine of the angle <var>theta</var>,
  892. and returns the result in <var>sinus</var> and <var>cosinus</var>.
  893. On Intel hardware, This calculation will be faster than making 2 calls
  894. to clculatet he sine and cosine separately.
  895. </descr>
  896. <errors>
  897. None.
  898. </errors>
  899. <seealso>
  900. <link id="arcsin"/>
  901. <link id="arccos"/>.
  902. </seealso>
  903. <example file="mathex/ex41"/>
  904. </element>
  905. <element name="sinh">
  906. <short></short>
  907. <descr>
  908. <var>Sinh</var> returns the hyperbolic sine of its argument <var>x</var>.
  909. </descr>
  910. <errors>
  911. </errors>
  912. <seealso>
  913. <link id="cosh"/>
  914. <link id="arsinh"/>
  915. <link id="tanh"/>
  916. <link id="artanh"/>
  917. </seealso>
  918. <example file="mathex/ex42"/>
  919. </element>
  920. <element name="stddev">
  921. <short></short>
  922. <descr>
  923. <var>Stddev</var> returns the standard deviation of the values in <var>Data</var>.
  924. It returns zero if there is only one value.
  925. The second form of the function accepts a pointer to an array of <var>N</var>
  926. values.
  927. </descr>
  928. <errors>
  929. None.
  930. </errors>
  931. <seealso>
  932. <link id="mean"/>
  933. <link id="meanandstddev"/>
  934. <link id="variance"/>
  935. <link id="totalvariance"/>
  936. </seealso>
  937. <example file="mathex/ex43"/>
  938. </element>
  939. <element name="sum">
  940. <short></short>
  941. <descr>
  942. <var>Sum</var> returns the sum of the values in the <var>data</var> array.
  943. The second form of the function accepts a pointer to an array of <var>N</var>
  944. values.
  945. </descr>
  946. <errors>
  947. None.
  948. </errors>
  949. <seealso>
  950. <link id="sumofsquares"/>
  951. <link id="sumsandsquares"/>
  952. <link id="totalvariance"/>
  953. , <link id="variance"/>
  954. </seealso>
  955. <example file="mathex/ex44"/>
  956. </element>
  957. <element name="sumofsquares">
  958. <short></short>
  959. <descr>
  960. <var>Sumofsquares</var> returns the sum of the squares of the values in the <var>data</var>
  961. array.
  962. The second form of the function accepts a pointer to an array of <var>N</var>
  963. values.
  964. </descr>
  965. <errors>
  966. None.
  967. </errors>
  968. <seealso>
  969. <link id="sum"/>
  970. <link id="sumsandsquares"/>
  971. <link id="totalvariance"/>
  972. , <link id="variance"/>
  973. </seealso>
  974. <example file="mathex/ex45"/>
  975. </element>
  976. <element name="sumsandsquares">
  977. <short></short>
  978. <descr>
  979. <var>sumsandsquares</var> calculates the sum of the values and the sum of
  980. the squares of the values in the <var>data</var> array and returns the
  981. results in <var>sum</var> and <var>sumofsquares</var>.
  982. The second form of the function accepts a pointer to an array of <var>N</var>
  983. values.
  984. </descr>
  985. <errors>
  986. None.
  987. </errors>
  988. <seealso>
  989. <link id="sum"/>
  990. <link id="sumofsquares"/>
  991. <link id="totalvariance"/>
  992. , <link id="variance"/>
  993. </seealso>
  994. <example file="mathex/ex46"/>
  995. </element>
  996. <element name="tan">
  997. <short></short>
  998. <descr>
  999. <var>Tan</var> returns the tangent of <var>x</var>.
  1000. </descr>
  1001. <errors>
  1002. If <var>x</var> (normalized) is pi/2 or 3pi/2 then an overflow will occur.
  1003. </errors>
  1004. <seealso>
  1005. <link id="tanh"/>
  1006. <link id="arcsin"/>
  1007. <link id="sincos"/>
  1008. <link id="arccos"/>
  1009. </seealso>
  1010. <example file="mathex/ex47"/>
  1011. </element>
  1012. <element name="tanh">
  1013. <short></short>
  1014. <descr>
  1015. <var>Tanh</var> returns the hyperbolic tangent of <var>x</var>.
  1016. </descr>
  1017. <errors>
  1018. None.
  1019. </errors>
  1020. <seealso>
  1021. <link id="arcsin"/>
  1022. <link id="sincos"/>
  1023. <link id="arccos"/>
  1024. </seealso>
  1025. <example file="mathex/ex48"/>
  1026. </element>
  1027. <element name="totalvariance">
  1028. <short></short>
  1029. <descr>
  1030. <var>TotalVariance</var> returns the total variance of the values in the
  1031. <var>data</var> array. It returns zero if there is only one value.
  1032. The second form of the function accepts a pointer to an array of <var>N</var>
  1033. values.
  1034. </descr>
  1035. <errors>
  1036. None.
  1037. </errors>
  1038. <seealso>
  1039. <link id="variance"/>
  1040. <link id="stddev"/>
  1041. <link id="mean"/>
  1042. </seealso>
  1043. <example file="mathex/ex49"/>
  1044. </element>
  1045. <element name="variance">
  1046. <short></short>
  1047. <descr>
  1048. <var>Variance</var> returns the variance of the values in the
  1049. <var>data</var> array. It returns zero if there is only one value.
  1050. The second form of the function accepts a pointer to an array of <var>N</var>
  1051. values.
  1052. </descr>
  1053. <errors>
  1054. None.
  1055. </errors>
  1056. <seealso>
  1057. <link id="totalvariance"/>
  1058. <link id="stddev"/>
  1059. <link id="mean"/>
  1060. </seealso>
  1061. <example file="mathex/ex50"/>
  1062. </element>
  1063. </module>
  1064. </package>
  1065. </fpdoc-descriptions>