Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-7010

msvcrt: exponential notation precision in scanf

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Fix Version/s: None
    • Component/s: CRT
    • Labels:

      Description

      The problem is in parsing exponential notation precision lack. The reason is using float instead of double as scaling value and iterative multiplication of source value instead of single one, which leads to error accumulation. Patch is in attachment.

      According to testman:
      scanf.c:116: Test failed: Got 1.100000491738425600e-030, expected 1.100000000000000000e-030

      at:
      34 double double_res;
      ...
      113 strcpy(buffer, "1.1e-30");
      114 ret = sscanf(buffer, "%lf", &double_res);
      116 ok(double_res >= 1.1e-30-1e-45 && double_res <= 1.1e-30+1e-45,
      117 "Got %.18le, expected %.18le\n", double_res, 1.1e-30);

      After applying patch test is passed successfully.

      PS. Is there any sense of fixing those problems exposed by tests, or it is better just to wait for sync with wine?

        Attachments

          Activity

            People

            • Assignee:
              ThePhysicist Timo Kreuzer
              Reporter:
              dmitry216 dmitry216
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: