|
Last change
on this file since 776 was 772, checked in by David Azarewicz, 7 months ago |
|
Merge in changes from 6.6-LTS branch.
Fixed additional 25+ problems.
|
|
File size:
648 bytes
|
| Line | |
|---|
| 1 | /* SPDX-License-Identifier: GPL-2.0 */
|
|---|
| 2 | #ifndef _LINUX_MATH_H
|
|---|
| 3 | #define _LINUX_MATH_H
|
|---|
| 4 | #if 0
|
|---|
| 5 | /*
|
|---|
| 6 | * Divide positive or negative dividend by positive or negative divisor
|
|---|
| 7 | * and round to closest integer. Result is undefined for negative
|
|---|
| 8 | * divisors if the dividend variable type is unsigned and for negative
|
|---|
| 9 | * dividends if the divisor variable type is unsigned.
|
|---|
| 10 | */
|
|---|
| 11 | #define DIV_ROUND_CLOSEST(x, divisor)( \
|
|---|
| 12 | {
|
|---|
| 13 | int __x = x; \
|
|---|
| 14 | int __d = divisor; \
|
|---|
| 15 | (((int)-1) > 0 || \
|
|---|
| 16 | ((int)-1) > 0 || \
|
|---|
| 17 | (((__x) > 0) == ((__d) > 0))) ? \
|
|---|
| 18 | (((__x) + ((__d) / 2)) / (__d)) : \
|
|---|
| 19 | (((__x) - ((__d) / 2)) / (__d)); \
|
|---|
| 20 | }
|
|---|
| 21 | )
|
|---|
| 22 | #endif
|
|---|
| 23 | #endif
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.