I am stuck at pset 1 - greedy. I only receive a wrong output at the values 1.6 and 0.15. At both outputs the value is by one to high.
:) greedy.c exists
:) greedy.c compiles
:) input of 0.41 yields output of 4
:) input of 0.01 yields output of 1
:( input of 0.15 yields output of 2 \ expected output, but not "3\n"
:( input of 1.6 yields output of 7 \ expected output, but not "8\n"
:) input of 23 yields output of 92
:) input of 4.2 yields output of 18
:) rejects a negative input like -.1
:) rejects a non-numeric input of "foo"
:) rejects a non-numeric input of ""
I have no clue what the reason is for that. Is there anybody who could help me? Thanks!
Here is my code: