¿ªÔÆÌåÓý

Re: round () function on AC measurements does crash on old versions and just delivers zero at latest version


 

¿ªÔÆÌåÓý

From the Help, under Waveform Arithmetic:

The functions Re(x) and Im(x) are available for complex data and return a complex number with the real part equal to the real or imaginary part of the argument respectively and the imaginary part equal to zero.

I wonder why that is so. The zero imaginary part seems useless, and it prevents, for example, the syntax Re(round(expression)) being used to produce the result that the OP wants.

On 2025-05-20 15:22, Andy I via groups.io wrote:
I don't know if this is related --
?
But mag() returns a complex number in .AC analysis.? Perhaps round() can only take a real argument.? Giving round() a complex argument might be the cause of both problems - the crash in earlier versions, and returning 0 in the latest version.
?
Referring to the Help page, it implies that round(x) was perhaps able to accept complex arguments, originally.? It is not listed as one of the exceptions that does not accept complex data.? Perhaps it had that ability but lost it somewhere along the way, while LTspice evolved, and nobody reported it, or someone did but it was not yet taken up as an action item to fix.? Have you reported it to ADI?
?
By the way, the results you pasted into the message appear to have included some non-ASCII text (0?¡ã), which probably did not look like that originally.
?
Andy
?
--
Best wishes John Woodgate RAYLEIGH Essex OOO-Own Opinions Only If something is true: * as far as we know - it's science *for certain - it's mathematics *unquestionably - it's religion

Virus-free.

Join [email protected] to automatically receive all group messages.