Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4179556

Floating point differences in math.c on OpenVMS platform

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      For the JDK 116 release on the OpenVMS platform running on DIGITAL's
      hardware, DIGITAL has changed, the following JDK 116 source file
      in the shared part of the JDK.

      - The following files were modified because of differences in the Alpha
      hardware on which OpenVMS runs:

      - Floating point differences
              src/share/java/lang/math.c

      diff -c -r JDK116/src/share/java/lang/math.c
      sun_JDK116/src/share/java/lang/math.c
      *** JDK116/src/share/java/lang/math.c Sun May 31 14:22:36 1998
      --- sun_JDK116/src/share/java/lang/math.c Thu Apr 16 13:49:48 1998

      ***************
      *** 250,259 ****
            double result;
            int length;

      - #ifdef __VMS
      - errno =0;
      - #endif
      -
            if (s == NULL) {
              SignalError(0, JAVAPKG "NullPointerException", 0);
              return 0;
      --- 249,254 ----
      ***************
      *** 275,334 ****
              SignalError(0, JAVAPKG "NumberFormatException", buf);
              result = 0.0;
            } else {
      - #ifndef __VMS
              if ((errno == ERANGE) && (result == 0.0)) {
                  /* maybe denorm(win32) */
                  result = atof(buf);
              }
      - #else
      - /* overflow */
      - /* VMS does't return the overflow and under flow the same as
      - Digital Unix. Change the results to match Unix Powell MPH*/
      - if ((errno == ERANGE) &&((result ==DBL_MAX) || (result==-DBL_MAX)))
      - {
      - if (result>0.0)
      - result = DBL_INFINITY;
      - else
      - result = - DBL_INFINITY;
      - }
      - else
      - if ((errno == ERANGE) && (result == 0.0))/* underflow*/
      - {
      - char *temp_ptr;
      - int *temp_int;
      - temp_ptr = buf;
      - temp_int = (int *) &result; /* only need the bottom part*/
      - *temp_int = 0x00000001;
      - while(*temp_ptr == ' ') temp_ptr++;
      - if (*temp_ptr == '-')
      - result = result * (-1);
      - /* could to 0.0 of e-324 */
      - if ((temp_ptr = strchr(buf,'e')) ||
      - (temp_ptr = strchr(buf,'E')))
      - {
      - temp_ptr++;
      - if (atoi((const char *) temp_ptr)< -324)
      - result = 0.0; /*real underflow*/
      - else
      - {
      - double temp_results;
      - temp_ptr--;
      - *temp_ptr = '\0'; /* drop off the e-324**/
      - temp_results = strtod(buf,&p);
      - if ((temp_results<4.94065645841246544) &&
      - (temp_results> -4.94065645841246544))
      - {
      - result = 0.0; /* real underflow */
      - errno = ERANGE;
      - }
      - else
      - errno =0;
      - }
      - }
      - else
      - errno =0;
      - }
      - #endif
            }
            if (buf != buffer) {
              sysFree(buf);
      --- 270,279 ----

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              apalanissunw Anand Palaniswamy (Inactive)
              Reporter:
              jbenoit Jonathan Benoit (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: