Re: POW Function

2018-07-25 Thread Cannon Smith via 4D_Tech
Hi Andrew, Thanks for the answer. Also, thanks to Miyako and Jeremy. Spencer actually helped me get this figured out offline, but I didn’t realize we’d gone offline. So its all taken care of. Thanks. -- Cannon.Smith Synergy Farm Solutions Inc. Hill Spring, AB Canada 403-626-3236 > On Jul

Re: POW Function

2018-07-25 Thread Keisuke Miyako via 4D_Tech
I won't recommend it, but just to illustrate the difference: $rRange:=1200-50 C_LONGINT($rExponent) Begin SQL SELECT LOG10(:$rRange) FROM _USER_SCHEMAS LIMIT 1 INTO :$rExponent End SQL $rMagnitude:=10^$rExponent > But I’m getting an exponent of 7 instead of 3. Any ideas what I’m doing wrong?

Re: POW Function

2018-07-25 Thread Jeremy Roussak via 4D_Tech
> On 24 Jul 2018, at 17:32, Cannon Smith via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > > In 4D I’m doing this: > > $rRange:=1200-50 > $rExponent:=Int(Log($rRange)) > $rMagnitude:=10^$rExponent > > But I’m getting an exponent of 7 instead of 3. Any ideas what I’m doing wrong? > > Thanks.

Re: POW Function

2018-07-24 Thread Spencer Hinsdale via 4D_Tech
difference btwn log and natural log. try LOG10 > On Jul 24, 2018, at 9:32 AM, Cannon Smith via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > > But I’m getting an exponent of 7 instead of 3. Any ideas what I’m doing wrong? >

Re: POW Function

2018-07-24 Thread Cannon Smith via 4D_Tech
Hi Spencer, Yes, it is! So simple. Thank you. Perhaps some more help from someone? I’m trying to translate some code on the web into 4D. Here are the lines of code along with an explanation: range = max - min; exponent = int(log(range)); magnitude = pow(10, exponent); //So, for example, if

Re: POW Function

2018-07-24 Thread Spencer Hinsdale via 4D_Tech
is it caret? 7^3 > On Jul 24, 2018, at 9:15 AM, Cannon Smith via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > I’m looking for an equivalent function in 4D as the pow function in other > languages. For example: > > > <https://developer.mozilla.org/en

POW Function

2018-07-24 Thread Cannon Smith via 4D_Tech
I’m looking for an equivalent function in 4D as the pow function in other languages. For example: <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow> Does anyone know how to do this? My math is really rusty. Thanks. -- Cannon.Smith Synerg