28.2.50 __builtin_flim

Architecture

dsPIC33C/E/F, dsPIC30

Description

Force (Signed) Data Range Limit. Simultaneously compares a 16-bit signed data value to a maximum signed limit value and a minimum signed limit value.

If the data value is greater than the maximum, the data value is set to the maximum value.

If the data value is less than the minimum, the data value is set to the minimum value.

If the data value is within the maximum-minimum values, the data value is not changed.

Prototype

int16_t __builtin_flim(int16_t value, int16_t high, int16_t low);

Arguments

value – Data value

high – Maximum limit value

low – Minimum limit value

Return Value

Returns value clamped between high and low.

Machine Instruction

flim

Error Messages

None