Topic: [Bug?] Clamp: Can't define minimum value as negative.

clamp($x, -160, 160)

X can equal anything, but this will still fail.

clamp($x, 0, 160)

And yet that works. Is this intended? Its a fairly easy work around with some subtraction, but I still noticed this.

Re: [Bug?] Clamp: Can't define minimum value as negative.

Please define "fail". A crash? An incorrect result?

what happens if you switch

clamp($x, -160, 160)

for

clamp($x, 0-160, 160)

???????

Re: [Bug?] Clamp: Can't define minimum value as negative.

Alexandre wrote:

Please define "fail". A crash? An incorrect result?

what happens if you switch

clamp($x, -160, 160)

for

clamp($x, 0-160, 160)

???????

... it works if I do that.

Re: [Bug?] Clamp: Can't define minimum value as negative.

what fails?

Re: [Bug?] Clamp: Can't define minimum value as negative.

I get a nanoparser error and it crashes

Nanocalc Error! Syntax Error near ' -120, 120)' in 'clamp($x, -120, 120)'!