Stopping value wrapping when exceeding bit depth

It seems that IGOR automatically reassigns values that exceed bitdepth so that they wrap back around, ie in a 16 bit unsigned wave, the value 65536 becomes 0 and so on..

Is there any quick way to disable this property and instead get it to "max out" such that (in this case) values greater than 65535 are set to 65535? Obviously I can put some code in that will check each time and do the necessary arithmatic, but this will greatly reduce my program runtimes. Im hoping there are some flags somewhere or neat tricks with redimension (seems to keep the wrapping behavior so far)..
No automatic way, but you can assign to the wave using the limit() function:

limit(num, low, high )

The limit function returns num, limited to the range from low to high :
num if low <= num <= high.
low if num < low .
high if num > high.

So wherever you have:

wave0 = value

replace that with:

wave0= limit(value,0,65535)

--Jim Prouty
Software Engineer, WaveMetrics, Inc.