Discussion:
A5P1-testFloatingPointPercision
(too old to reply)
Michael W
2010-10-21 04:48:33 UTC
Permalink
I'm having a problem with testFloatingPointPrecision2, and
testFloatingPointPrecision3; I'm not really sure what kind of test
marmoset might be doing at all. Is it something to do with decimal
places?
David Xingliang Lou (CS 137 Tutor)
2010-10-21 14:39:42 UTC
Permalink
Post by Michael W
I'm having a problem with testFloatingPointPrecision2, and
testFloatingPointPrecision3; I'm not really sure what kind of test
marmoset might be doing at all. Is it something to do with decimal
places?
Did you come to the tutorial? =)

All the constants are initialized with TWO decimal places. We do NOT
have test cases like 12.345, for example.
Michael W
2010-10-25 23:14:25 UTC
Permalink
On Oct 21, 10:39 am, "David Xingliang Lou (CS 137 Tutor)"
Post by David Xingliang Lou (CS 137 Tutor)
Post by Michael W
I'm having a problem with testFloatingPointPrecision2, and
testFloatingPointPrecision3; I'm not really sure what kind of test
marmoset might be doing at all. Is it something to do with decimal
places?
Did you come to the tutorial? =)
All the constants are initialized with TWO decimal places. We do NOT
have test cases like 12.345, for example.
Thanks for the help in the tutorial last week! The problem is is that
I tested for 0.9999 to 0.thirteen 9s and I still can't pass
testFloatingPointPercision5, so I'm really at a loss as to what to do.
David Xingliang Lou (CS 137 Tutor)
2010-10-27 20:09:54 UTC
Permalink
On Oct 21, 10:39 am, "David Xingliang Lou (CS 137 Tutor)"
Post by David Xingliang Lou (CS 137 Tutor)
Post by Michael W
I'm having a problem with testFloatingPointPrecision2, and
testFloatingPointPrecision3; I'm not really sure what kind of test
marmoset might be doing at all. Is it something to do with decimal
places?
Did you come to the tutorial? =)
All the constants are initialized with TWO decimal places. We do NOT
have test cases like 12.345, for example.
Thanks for the help in the tutorial last week! The problem is is that
I tested for 0.9999 to 0.thirteen 9s and I still can't pass
testFloatingPointPercision5, so I'm really at a loss as to what to do.
Mmmm...

How about this: What if the average is an integer, with a negative
round-off error (for example, 0.9999999...). Would your program output 1
dollars and 0 cents? Or 0 dollars and 100 cents?

Loading...