FMOD
Descriptionβ
Find the remainder of a / b for the floating-point type. For the integer type, please use the mod function.
Syntaxβ
MOD(<col_a> , <col_b>)
Parametersβ
Parameter | Description |
---|---|
<col_a> | Dividend |
<col_b> | Divisor should not be 0 |
Return valueβ
Return a float-point type. Special cases:
If col_a IS NULL or col_b IS NULL, return NULL.
Exampleβ
select fmod(10.1, 3.2);
+-----------------+
| fmod(10.1, 3.2) |
+-----------------+
| 0.50000024 |
+-----------------+
select fmod(10.1, 0);
+---------------+
| fmod(10.1, 0) |
+---------------+
| NULL |
+---------------+