| 253 | } |
| 254 | |
| 255 | static inline npy_int64 |
| 256 | rational_rint(rational x) { |
| 257 | /* |
| 258 | * Round towards nearest integer, moving exact half integers towards |
| 259 | * zero |
| 260 | */ |
| 261 | npy_int32 d_ = d(x); |
| 262 | return (2*(npy_int64)x.n+(x.n<0?-d_:d_))/(2*(npy_int64)d_); |
| 263 | } |
| 264 | |
| 265 | static inline int |
| 266 | rational_sign(rational x) { |
no test coverage detected