Re: Math functions? (Particularly transcendental ones)
Uri Guttman wrote: > > "BS" == Benjamin Stuhl <[EMAIL PROTECTED]> writes: > > >> Can anyone think of things I've forgotten? It's been a while since > >> I've done numeric work. > > BS> ln, asinh, acosh, atanh2? > > dan mentioned log (base anything) but i don't recall ln. and definitely > the arc hyberbolics are in after i pointed them out. dunno about atanh2. > We only really need ln(). Then [log(y) base x] is simply [ln(y)/ln(x)]. There's no need to have separate functions for different bases.
Re: Math functions? (Particularly transcendental ones)
On Sun, Sep 09, 2001 at 02:33:17PM +1000, Jeremy Howard wrote: > Uri Guttman wrote: > > > "BS" == Benjamin Stuhl <[EMAIL PROTECTED]> writes: > > > > >> Can anyone think of things I've forgotten? It's been a while since > > >> I've done numeric work. > > > > BS> ln, asinh, acosh, atanh2? > > > > dan mentioned log (base anything) but i don't recall ln. and definitely > > the arc hyberbolics are in after i pointed them out. dunno about atanh2. > > > We only really need ln(). Then [log(y) base x] is simply [ln(y)/ln(x)]. > There's no need to have separate functions for different bases. If we try to get away with just implementing ln(), we'll probably waste more time, space and effort answering FAQs about "How do I do log base X in Perl?" than we ever would just implementing log(y, base_x). Do ln(y) and log(y, base_x) and you pretty much cover everything. Besides, we have to have at least log(y) for backwards compatibility--and I don't think "because it's mathematically redundant" is a valid reason to bust compatibility for a tiny little function like log(). -- Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/ Perl6 Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One The desired effect is what you get when you improve your interplanetary funksmanship.
RE: Math functions? (Particularly transcendental ones)
Jeremy Howard: # Uri Guttman wrote: # > > "BS" == Benjamin Stuhl <[EMAIL PROTECTED]> writes: # > # > >> Can anyone think of things I've forgotten? It's been a # while since # > >> I've done numeric work. # > # > BS> ln, asinh, acosh, atanh2? # > # > dan mentioned log (base anything) but i don't recall ln. # and definitely # > the arc hyberbolics are in after i pointed them out. dunno # about atanh2. # > # We only really need ln(). Then [log(y) base x] is simply # [ln(y)/ln(x)]. # There's no need to have separate functions for different bases. "OISC: You've heard of RISC, Reduced Instruction Set Computers? Well, here is the concept taken to its logical extreme -- an emulator for a computer with just one (1) instruction (Subtract and Branch if Negative)! Sample programs in the OISC machine language are included. We now have available have a revised and expanded version of oisc called OIC. In the future, this may replace OISC." from http://www.tuxedo.org/~esr/retro/ :^) --Brent Dax [EMAIL PROTECTED] "...and if the answers are inadequate, the pumpqueen will be overthrown in a bloody coup by programmers flinging dead Java programs over the walls with a trebuchet."
Re: Math functions? (Particularly transcendental ones)
On Sat, 08 Sep 2001 13:02:04 -0400, Dan Sugalski wrote: >>Uri mentioned exp(x) = e^x, but I think if you are going to include >>log2, log10, log, etc, you should also include ln. > >Added. Er... aren't ln and log synonyms? -- Bart.
Re: Math functions? (Particularly transcendental ones)
> "BL" == Bart Lateur <[EMAIL PROTECTED]> writes: BL> On Sat, 08 Sep 2001 13:02:04 -0400, Dan Sugalski wrote: >>> Uri mentioned exp(x) = e^x, but I think if you are going to include >>> log2, log10, log, etc, you should also include ln. >> >> Added. BL> Er... aren't ln and log synonyms? we are using log as in log( base, num ) where you can specify the log base. ln is just log( e, num ). same for log2 and log10. those are just the most common bases for logs. no reason not to support all of them in parrot as they are trivial wrappers (and they save an argument per call). they can also be in the math module where again they will be simple wrappers. uri -- Uri Guttman - [EMAIL PROTECTED] -- http://www.sysarch.com SYStems ARCHitecture and Stem Development -- http://www.stemsystems.com Search or Offer Perl Jobs -- http://jobs.perl.org