Skip to main content
replaced http://cs50.stackexchange.com/ with https://cs50.stackexchange.com/
Source Link

The point of this pset is to understand how floats are stored in a computer and the ramifications of that imprecise storage. As written, your program depends on exact representation of numbers in the computer, but the very imprecision of those floats is causing your difficulties.

What is wrong with this code for greedy (pset1)?What is wrong with this code for greedy (pset1)? goes into more detail, and you should consider reviewing the class material on floats.

If this answers your question, please click on the check mark to accept. Let's keep up on forum housekeeping. ;-)

The point of this pset is to understand how floats are stored in a computer and the ramifications of that imprecise storage. As written, your program depends on exact representation of numbers in the computer, but the very imprecision of those floats is causing your difficulties.

What is wrong with this code for greedy (pset1)? goes into more detail, and you should consider reviewing the class material on floats.

If this answers your question, please click on the check mark to accept. Let's keep up on forum housekeeping. ;-)

The point of this pset is to understand how floats are stored in a computer and the ramifications of that imprecise storage. As written, your program depends on exact representation of numbers in the computer, but the very imprecision of those floats is causing your difficulties.

What is wrong with this code for greedy (pset1)? goes into more detail, and you should consider reviewing the class material on floats.

If this answers your question, please click on the check mark to accept. Let's keep up on forum housekeeping. ;-)

Source Link
Cliff B
  • 69.3k
  • 4
  • 33
  • 56

The point of this pset is to understand how floats are stored in a computer and the ramifications of that imprecise storage. As written, your program depends on exact representation of numbers in the computer, but the very imprecision of those floats is causing your difficulties.

What is wrong with this code for greedy (pset1)? goes into more detail, and you should consider reviewing the class material on floats.

If this answers your question, please click on the check mark to accept. Let's keep up on forum housekeeping. ;-)