POW(X,Y) doesn’t work in a function directive with the x**y syntax


didier
 

Hello,

I've checked this with a Bsource both two syntaxes work fine

b3 n001 0 v=(pow(-1,round((- 2 *((1)-1)/2+1)/- 1)))

b1 n002 0 v=(-1)**round((- 2 *(1 -1)/2+1)/- 1)

With a bsource using a function directive only one works

b3 n001 V=ch2(zz) neither V=ch3(zz) wrong

b3 n001 V=ch4(zz) good

.param a=2 b=1 zz=1

.func ch2(x)=(-1)**round((-a*(x-1)/2+1)/(-1)/b); ==> errorlog
(-1)**round((- 2 *(( 1 )-1)/2+1)/(-1)/ 1 «))»

.func ch3(x)=(-1)**round((-a*(x-1)/2+1)/-b) ; ==> errorlog
(-1)**round((- 2 *(( 1 )-1)/2+1)/- 1 «))»

.func ch4(x)=pow(-1,round((-a*(x-1)/2+1)/-b)) ; ==> good



I'am sure that two syntaxes were correct before because almost all
the files in the below section provide errors

Files > Examples > Educational > Power_Conditioning



Regards

Didier


 

Hello Didier

The reason for that is because of the syntax for .func, it should be by the book:
.func f(x) {...}
not f(x)=...

There may also be some outdated symbols/libraries. I'll make the changes and update the files with the correct syntax later (but possibly much later).


Vlad


Cadinot Didier
 

Thanks a lot Vlad.
Youve done a very good job
Ive download your last update Your examples work now
Didier



De : LTspice@... [mailto:LTspice@...] De la part de imbvlad
Envoy� : samedi 20 juillet 2013 07:48
� : LTspice@...
Objet : [LTspice] Re: POW(X,Y) doesnt work in a function directive with the x**y syntax



Hello Didier

The reason for that is because of the syntax for .func, it should be by the book:
.func f(x) {...}
not f(x)=...

There may also be some outdated symbols/libraries. I'll make the changes and update the files with the correct syntax later (but possibly much later).

Vlad



[Non-text portions of this message have been removed]


 

Your feedback is much appreciated, thank you for the kind words.


Vlad