pc(1): if the input base is not 10, print the 0d prefix before decimal numbers; this way, all output is always valid input (for the current mode)
This commit is contained in:
parent
bb823caa28
commit
11e40fc6b4
1 changed files with 1 additions and 1 deletions
|
@ -299,7 +299,7 @@ numprint(Num *n)
|
||||||
if(mpcmp(n, mpzero) != 0)
|
if(mpcmp(n, mpzero) != 0)
|
||||||
switch(b){
|
switch(b){
|
||||||
case 16: *--q = 'x'; *--q = '0'; break;
|
case 16: *--q = 'x'; *--q = '0'; break;
|
||||||
case 10: if(outbase != 0 && outbase != 10) {*--q = 'd'; *--q = '0';} break;
|
case 10: if(outbase != 0 && outbase != 10 || inbase != 10) {*--q = 'd'; *--q = '0';} break;
|
||||||
case 8: *--q = '0'; break;
|
case 8: *--q = '0'; break;
|
||||||
case 2: *--q = 'b'; *--q = '0'; break;
|
case 2: *--q = 'b'; *--q = '0'; break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue