Discussion:
Incorrect Reference Behaviour (PreciseMoney)
(too old to reply)
Brian Attwell
2010-05-23 02:49:58 UTC
Permalink
It seems like there are some problems with the new reference executable,
PreciseMoney. Using the example from the assignment, "-$2.222", gives a
result of "-$2.22" on linux006. The result should be "-$2.23" shouldn't it?

Confusingly, running Money.out gives the opposite problem. "-$2.22" results
in "-$2.23".
Joanne Atlee
2010-05-23 15:27:30 UTC
Permalink
Post by Brian Attwell
It seems like there are some problems with the new reference executable,
PreciseMoney. Using the example from the assignment, "-$2.222", gives a
result of "-$2.22" on linux006. The result should be "-$2.23" shouldn't it?
Confusingly, running Money.out gives the opposite problem. "-$2.22" results
in "-$2.23".
A longer answer to this question is given in the response to the posting
titled "Unspecified Behaviour".

The short answer is: keep inputs (for Money values and multiplication
factors) to no more than 2 decimal places.


Jo
Robert Taylor
2010-05-24 02:06:30 UTC
Permalink
Post by Joanne Atlee
Post by Brian Attwell
It seems like there are some problems with the new reference executable,
PreciseMoney. Using the example from the assignment, "-$2.222", gives a
result of "-$2.22" on linux006. The result should be "-$2.23"
shouldn't it?
Confusingly, running Money.out gives the opposite problem. "-$2.22" results
in "-$2.23".
A longer answer to this question is given in the response to the posting
titled "Unspecified Behaviour".
The short answer is: keep inputs (for Money values and multiplication
factors) to no more than 2 decimal places.
Jo
Do you mean truncate the input to two decimal places?
CS 246 SE Tutor
2010-05-24 04:19:12 UTC
Permalink
What she means is that when comparing your implementation to our
executables, you should only test input values (Money values or
multiplication factors) with up to 2 decimal places.

Casey
Post by Robert Taylor
Post by Joanne Atlee
Post by Brian Attwell
It seems like there are some problems with the new reference executable,
PreciseMoney. Using the example from the assignment, "-$2.222", gives a
result of "-$2.22" on linux006. The result should be "-$2.23" shouldn't it?
Confusingly, running Money.out gives the opposite problem. "-$2.22" results
in "-$2.23".
A longer answer to this question is given in the response to the posting
titled "Unspecified Behaviour".
The short answer is: keep inputs (for Money values and multiplication
factors) to no more than 2 decimal places.
Jo
Do you mean truncate the input to two decimal places?
Loading...