Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Measure::simplify()
- {
- // make the amount bigger if it is less than 1, unless the unit is already
- //"dram" (in which case the amount can't be made any bigger).
- Measure temp;
- while (unit!=0 && amount < 1) {
- temp.amount = conversionTable[unit - 1];
- amount = amount *temp.amount;
- unit--;
- }
- //make the amount smaller if it can be made smaller without making it
- //less than 1, unless the unit is already acre_ft (in which case the
- //amount can't be made any smaller)
- while (unit!=11 && amount > 1 ) {
- temp.amount = conversionTable[unit];
- amount *= (1 / temp.amount);
- unit++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement