pmod
The pmod function is used to return the positive modulus of a divided by b.
Syntax
pmod(INT a, INT b)
Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| a | Yes | DOUBLE, BIGINT, DECIMAL, or STRING | The format of parameter a includes floating-point format, integer format, and string format. |
| b | Yes | DOUBLE, BIGINT, DECIMAL, or STRING | The format of parameter b includes floating-point format, integer format, and string format. |
Return Values
Returns a value of type DECIMAL or INT.
- If a or b is NULL, NULL is returned.
- If b is 0, NULL is returned.
Example Code
Returns 2.
select pmod(2,5);
Returns 1.
select pmod(5,2);
Returns 0.877.
select pmod(5.123,2.123);
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot