Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-3744

The precision should be 17 (16 bits need after dot) after dot for double type.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.3
    • Fix Version/s: 0.10.0
    • Component/s: D - Library
    • Labels:
      None

      Description

      The precision is lost when converting double to string.
      E.g:
      double PI = 3.1415926535897931;
      string value = format("%.16g", PI);

      The value will be '3.141592653589793' and last 1 is lost after format operation.
      But expected value should be '3.1415926535897931'.

      Solution:
      string value = format("%.17g", PI);

        Attachments

          Activity

            People

            • Assignee:
              gityf WangYaofu
              Reporter:
              gityf WangYaofu
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: