| 316 | } |
| 317 | |
| 318 | void setSpecial(decNumber* number, decClass cl, int sign) |
| 319 | { |
| 320 | decNumberZero(number); |
| 321 | |
| 322 | switch(cl) |
| 323 | { |
| 324 | case DEC_CLASS_SNAN: |
| 325 | number->bits |= DECSNAN; |
| 326 | break; |
| 327 | |
| 328 | case DEC_CLASS_QNAN: |
| 329 | number->bits |= DECNAN; |
| 330 | break; |
| 331 | |
| 332 | case DEC_CLASS_NEG_INF: |
| 333 | case DEC_CLASS_POS_INF: |
| 334 | number->bits |= DECINF; |
| 335 | break; |
| 336 | |
| 337 | default: |
| 338 | fb_assert(false); |
| 339 | break; |
| 340 | } |
| 341 | |
| 342 | if (sign) |
| 343 | number->bits |= DECNEG; |
| 344 | } |
| 345 | |
| 346 | } // anonymous namespace |
| 347 |