Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-28518

Inconsistent outputs from hypot (math) functions in Red Hat Enterprise Linux 7

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • None
    • rhel-7.9
    • gcc
    • None
    • None
    • Moderate
    • rhel-sst-pt-gcc
    • ssg_platform_tools
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None

      What were you trying to do that didn't work?

       

      • On Red Hat Enterprise Linux 7, the hypot output returns "inf", while the same execution returns "nan" on the latest RHEL release as on Red Hat Enterprise Linux 8.9 and Red Hat Enterprise Linux 9.3.
      • In Red Hat Enterprise Linux 7 there is a bug in libm as the hypot output returns "nan".

      Please provide the package NVR for which bug is seen:

      libm,GCC from RHEL 7

      How reproducible: Always

       

      Steps to reproduce:

      Save the attached code in a c file as "test.c".

      Compile this code and create out file with below command:

      # gcc -lm test.c
      {{}}
      Now execute the out file and check the results:
      {{}}
      on RHEL8: The result is same on first gcc package shipped with RHEL8 till latest:

      1. ./a.out
        a = nan
        hypot = nan <<---------

      on RHEL7: The result is same on first gcc package shipped with RHEL7 till latest:

      1. ./a.out
        a = nan
        hypot = inf <<---------

        Expected results: the hypot output returns "nan"

        Actual results: the hypot output returns "inf"

              mpolacek@redhat.com Marek Polacek
              rhn-support-vrajput Virendrasingh Rajput
              Marek Polacek Marek Polacek
              inactive-user inactive-user
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: