Uploaded image for project: 'PBS Pro'
  1. PP-1316

Json reports big integers as inf without double quotes leading to parse failure

    Details

    • Type: Bug
    • Status: Open
    • Priority: Low
    • Resolution: Unresolved
    • Affects versions: None
    • Fix versions: None
    • Components: None
    • Labels:
      None
    • Sprint:
    • Story Points:
      1

      Description

      [root@centos json]# gcc trial.c
      [root@centos json]# ./a.out 10000000000
      long int: 10000000000
      [root@centos json]# ./a.out 100000000000000000000
      double: 100000000000000000000.000000
      [root@centos json]# ./a.out 10000000000000000000000000000000000000000
      double: 10000000000000000303786028427003666890752.000000
      [root@centos json]# ./a.out 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
      double: inf
      [root@centos json]# cat trial.c
      #include<stdio.h>
      #include<stdlib.h>

      main(int argc, char **argv) {
      double val;
      char *pc;
      long int ivalue = 0;
      void *value = argv[1];
      if (value)

      { val = strtod(value, &pc); ivalue = (long int) val; if (val == ivalue) printf("long int: %ld\n", ivalue); else printf("double: %lf\n", (double)val); }


      return 0;
      }
      [root@centos json]#

      https://www.exploringbinary.com/a-bug-in-the-bigcomp-function-of-david-gays-strtod/

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              nithinpottackal Nithin Johnson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: