Languages :: Pascal :: i need function for POWER and LOGRITHM of base N |
|||
| By: collegeBoy |
Date: 16/11/2002 00:00:00 |
Points: 50 | Status: Answered Quality : Excellent |
|
Thanks for ur post. At this moment I will accept any suggestions about any Power FUNCTION (i.e. I want to find the power of 2 million to the power -0.35…. that is .. (2000000) to the power -0.035) One other thing, I want a program for the logarithm of base N (i.e. log |
|||
| By: monange | Date: 16/11/2002 09:53:00 | Type : Comment |
|
| Turbo Pascal Exp(x : real); Ln(x : real); eg var y : real; y := exp(3.1234); |
|||
| By: monange | Date: 16/11/2002 09:54:00 | Type : Comment |
|
| And Stockton's page has all you want <A HREF="http://www.merlyn.demon.co.uk/pas-math.htm">http://www.merlyn.demon.co.uk/pas-math.htm</a> |
|||
| By: TheFalklands | Date: 02/12/2002 23:12:00 | Type : Comment |
|
| huh longtime ago we've created (we means me and math students from Katowice) nice Power function i'll see if I can find somewhere around. TFL |
|||
| By: VGR | Date: 07/12/2002 10:08:00 | Type : Answer |
|
| okay, 2000000^-0,35 is also Exp(Ln(2000000^-0,35)) = Exp(-0,35 * Ln(2000000)) so you'll end up needing an extended Exp() function able to handle large numbers and also negative arguments (which the standard "low-class" definition doesn't allow) You're lucky, I have one 8-) Interface {$E+} { ‚mulation active } {$N+} { 80x87 pr‚sent ou ‚mul‚ } Function ExpReal ( a, x : Extended ) : Extended; Implementation Function ExpReal; Var j : Byte; cons1 : Extended; c2 : Extended; Begin cons1:=(x*Ln(a)); If (cons1<1419) { avec 8087 } { correction de 1425 … 1419 le 25/09/94 } Then cons1:=Exp(cons1) { au lieu de re-calculer x*ln(a)) le 29/10/94 } Else Begin cons1:=1.0; { correction de 1 … 1.0 le 25/09/94 } c2:=ExpReal(a,100); { par tranches de 100 : par exemple... } { corr. 28/09/94 } For j:=1 to Trunc(x/100) Do cons1:=cons1*c2; { on ‚vite ainsi [x/100]-1 calculs } For j:=1 to Trunc(x-100*Trunc(x/100)) Do cons1:=cons1*a; End; ExpReal:=cons1; End; { ExpReal Extended Function } |
|||
| By: TheFalklands | Date: 16/06/2003 18:18:00 | Type : Comment |
|
| Is this Q still open? TFL. |
|||
| By: monange | Date: 16/06/2003 18:30:00 | Type : Comment |
|
| Yep, but the questioner has run away. |
|||
|
Do register to be able to answer |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








