Oracle MOD() function
Description
The Oracle MOD() is used to return the remainder of a dividend divided by a divisor. This function also works on fractional values and returns the exact remainder. The function returns dividend when the value of divisor is 0.
The function takes any numeric or nonnumeric data type (can be implicitly converted to a numeric data type) as an argument.
If the argument is BINARY_FLOAT, then the function returns BINARY_DOUBLE. Otherwise, the function returns the same numeric data type as the argument
Syntax:
MOD(N,M)
Arguments:
Name | Description |
---|---|
N | Dividend. |
M | Divisor. |
Pictorial Presentation of MOD() function
Example-1:
The statement below returns the remainder of17 divided by 2.
SELECT MOD(7,2) FROM dual;
Here is the result.
MOD(7,2) ---------- 1
Example-2:
The statement below returns the remainder of 7 divided by -2.
SELECT MOD(7,-2) FROM dual;
Here is the result.
MOD(7,-2) ---------- 1
Example-3:
The statement below returns the remainder of -7 divided by 2.
SELECT MOD(-7, 2);
Here is the result.
MOD(-7,2) ---------- -1
Example-4:
The statement below returns the remainder of -7 divided by -2.
SELECT MOD(-7, -2);
Here is the result.
MOD(-7,-2) ---------- -1
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework