------------------------------------------------------------------ */ decSetMaxValue -- set number to +Nmax (maximum normal value) */ / dn is the number to set */ set is the context [used for digits and emax] */ / This sets the number to the maximum positive value. */ --------------------------------------------------
| 7390 | /* This sets the number to the maximum positive value. */ |
| 7391 | /* ------------------------------------------------------------------ */ |
| 7392 | static void decSetMaxValue(decNumber *dn, decContext *set) { |
| 7393 | Unit *up; // work |
| 7394 | Int count=set->digits; // nines to add |
| 7395 | dn->digits=count; |
| 7396 | // fill in all nines to set maximum value |
| 7397 | for (up=dn->lsu; ; up++) { |
| 7398 | if (count>DECDPUN) *up=DECDPUNMAX; // unit full o'nines |
| 7399 | else { // this is the msu |
| 7400 | *up=(Unit)(powers[count]-1); |
| 7401 | break; |
| 7402 | } |
| 7403 | count-=DECDPUN; // filled those digits |
| 7404 | } // up |
| 7405 | dn->bits=0; // + sign |
| 7406 | dn->exponent=set->emax-set->digits+1; |
| 7407 | } // decSetMaxValue |
| 7408 | |
| 7409 | /* ------------------------------------------------------------------ */ |
| 7410 | /* decSetSubnormal -- process value whose exponent is <Emin */ |
no outgoing calls
no test coverage detected