Re: sqrt

2004-04-28 Thread Dan Sugalski
At 10:29 PM -0400 4/27/04, Matt Fowles wrote: All~ Perhaps it is just the mathematician in me speaking, but I think that a sqrt op might be superfluous and could be replaced with exp as sqrt(x) == exp(x,0.5). I cannot say anything about numerical stability of precision, though, so feel free

Re: sqrt

2004-04-28 Thread Uri Guttman
>>>>> "MF" == Matt Fowles <[EMAIL PROTECTED]> writes: MF> Perhaps it is just the mathematician in me speaking, but I think that MF> a sqrt op might be superfluous and could be replaced with exp as MF> sqrt(x) == exp(x,0.5). I cannot say anything abou

Re: sqrt

2004-04-27 Thread Peter Behroozi
On Tue, 2004-04-27 at 22:29, Matt Fowles wrote: > All~ > > Perhaps it is just the mathematician in me speaking, but I think that a > sqrt op might be superfluous and could be replaced with exp as sqrt(x) > == exp(x,0.5). I cannot say anything about numerical stability of >

Re: sqrt

2004-04-27 Thread Matt Fowles
All~ Perhaps it is just the mathematician in me speaking, but I think that a sqrt op might be superfluous and could be replaced with exp as sqrt(x) == exp(x,0.5). I cannot say anything about numerical stability of precision, though, so feel free to shoot me down. Matt Dan Sugalski wrote: At

Re: sqrt

2004-04-27 Thread Dan Sugalski
At 4:50 PM +0200 4/27/04, Stefan Lidman wrote: >Everything is right, except... you forgot either the -c or -u switch for the diff. (And no, I don't know why the default output from diffs is mostly useless. Just one of those things, I expect) ok resend with -u switch. And it's in. Thanks! --

Re: sqrt

2004-04-27 Thread Stefan Lidman
@ goto NEXT(); } + + +=item B(out NUM, in INT) + +=item B(out NUM, in NUM) + +Set $1 to the square root of $2. + +=cut + +inline op sqrt(out NUM, in INT) :base_core { + $1 = sqrt((FLOATVAL)$2); + goto NEXT(); +} + +inline op sqrt(out NUM, in NUM) :base_core { + $1 = sqrt((FLOATVAL)$2)

Re: sqrt

2004-04-27 Thread Dan Sugalski
At 3:29 AM +0200 4/27/04, Stefan Lidman wrote: This adds a square root op and fixes a typo. It is also my first patch so I might have missed something, please tell me what I did wrong. Everything is right, except... you forgot either the -c or -u switch for the diff. (And no, I don't know why the

sqrt

2004-04-27 Thread Stefan Lidman
/math.ops,v retrieving revision 1.17 diff -r1.17 math.ops 853a854,873 > > > =item B(out NUM, in INT) > > =item B(out NUM, in NUM) > > Set $1 to the square root of $2. > > =cut > > inline op sqrt(out NUM, in INT) :base_