| 268 | } |
| 269 | |
| 270 | static inline rational |
| 271 | rational_inverse(rational x) { |
| 272 | rational y = {0}; |
| 273 | if (!x.n) { |
| 274 | set_zero_divide(); |
| 275 | } |
| 276 | else { |
| 277 | npy_int32 d_; |
| 278 | y.n = d(x); |
| 279 | d_ = x.n; |
| 280 | if (d_ <= 0) { |
| 281 | d_ = safe_neg(d_); |
| 282 | y.n = -y.n; |
| 283 | } |
| 284 | y.dmm = d_-1; |
| 285 | } |
| 286 | return y; |
| 287 | } |
| 288 | |
| 289 | static inline int |
| 290 | rational_eq(rational x, rational y) { |
no test coverage detected