From: Eric B. <er...@go...> - 2007-02-16 13:11:11
|
Kwon, Jimmy Y. wrote: > Running the above test procedure with the fix produces the expected > results: > d1=941.65899999999817 > d2=941.659000000 > > Other test cases: > d := 941.99999999999817 > produces the expected: > d1=941.99999999999818 > d2=942.000000000 > > I haven't done exhaustive testing on this, but the temporary fix is > enough of a workaround for me at the moment. > > I hope this was helpful. Yes, thank you very much Jim. I made a quick review of your patch. In order to reuse memory space (and avoid to put too much on the GC), I think that I will but your `fff_list' list out of the routine and turn it to a DS_ARRAYED_LIST. That way it can be reused at each call instead of creating a new one each time. Apart from that, if nobody objects, I will keep your patch as-is. I ran our test cases with your patch and one test failed: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:\gobo\test\string>geant test_debug_ge Testing xstring... Preparing Test Cases Compiling Test Cases Running Test Cases Test Summary for xstring # Passed: 41 tests # FAILED: 1 test # Aborted: 0 test # Total: 42 tests (253 assertions) Test Results: FAIL: [ST_TEST_SCIENTIFIC_FORMATTER.test_other_examples] test6 expected: -123 100 400 123 c true some string 3.141593e+00 4.41593451 but got: -123 100 400 123 c true some string 3.141593e+00 3.14159346 BUILD FAILED! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ After looking at it, it looks like the test was wrong: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a_format := "$5i $4x $6o $u $c $b $3s $8e $7.8f " assert_equal ("test6", " -123 100 400 123 c true some string 3.141593e+00 4.41593451 ", format (a_format, << integer_cell (-123), integer_cell (256), integer_cell (256), integer_cell (123), character_cell ('c'), boolean_cell (True), "some string", double_cell (3.1415934563), double_cell (3.1415934563)>>)) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ and your patch allowed us to point it out. Indeed, applying $7.8f on 3.1415934563 cannot yield 4.41593451! Thank you. -- Eric Bezault mailto:er...@go... http://www.gobosoft.com |