math edge errors in manual
As stated above, sqrt of a negative argument isn't handled faithfully by the compatibility modes. Here's a potential fix and a repro deck. --- a/src/spicelib/parser/ptfuncs.c +++ b/src/spicelib/parser/ptfuncs.c @@ -320,8 +320,16 @@ double PTsqrt(double arg) { - if (arg < 0.0) + if (arg < 0.0) { + /* sqrt of a negative argument. LTspice 26.0.2 returns 0. PSpice + 23.1.0 returns sqrt(-4)=2, sqrt(-1)=1. Native mode keeps the + domain error. */ + if (newcompat.lt) + return (0.0); + if (newcompat.ps)...
Thanks for applying the patch!
byte order mark in lib causes fatal error