You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
319 B
22 lines
319 B
#include <cstdlib>
|
|
#include "util.h"
|
|
|
|
void append_expn(std::string &str, int expn) {
|
|
int k;
|
|
|
|
str += (expn < 0 ? '-' : '+');
|
|
expn = std::abs(expn);
|
|
|
|
if (expn >= 100) {
|
|
k = (expn / 100);
|
|
str += '0' + k;
|
|
expn -= 100*k;
|
|
}
|
|
|
|
k = (expn / 10);
|
|
str += '0' + k;
|
|
expn -= 10*k;
|
|
|
|
str += '0' + expn;
|
|
}
|
|
|