Concept Flow - ABS and MOD functions
Input number
ABS
Output result
The flow starts with an input number, then chooses ABS or MOD function. ABS returns the absolute value, MOD returns the remainder of division, then outputs the result.
SELECT ABS(-7) AS abs_val, MOD(17, 5) AS mod_val;
| Step | Function | Input | Calculation | Result |
|---|---|---|---|---|
| 1 | ABS | -7 | Absolute value of -7 | 7 |
| 2 | MOD | 17, 5 | 17 divided by 5 is 3 remainder 2 | 2 |
| 3 | END | - | - | - |
| Variable | Start | After ABS | After MOD | Final |
|---|---|---|---|---|
| abs_val | NULL | 7 | 7 | 7 |
| mod_val | NULL | NULL | 2 | 2 |
ABS(number): Returns the absolute (positive) value of number. MOD(number, divisor): Returns remainder after dividing number by divisor. Use ABS to remove negative sign. Use MOD to find leftover after division. Both return numeric results. Example: ABS(-7)=7, MOD(17,5)=2.