Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-25854 Ambari With Python3 Support
  3. AMBARI-25898

modify Function Divide from python2 to python3

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.7.5
    • None
    • ambari-server
    • Ambari:Ambari-2.7.5

      OS:        OpenEuler-22.03

      Python: Python 3.9.9

    Description

      in python2, divide operator function as follows:

          5 / 2 = 2

          5.0 / 2.0 = 2.5

      in python3, divide operator function as follows:

          5 / 2 = 2.5

          5.0 / 2.0 = 2.5

       

      which means that in python2, the function of divide operator is depended on the data type.

      If inputs are Integers,  it becomes integer division.

      If inputs are floating point number, it becomes float division.

       

      in order to perform the same function of python2 divide in python3, I would like to define a util funtion named "py2Divide(val1, val2)" to do this:

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            Charming603473 Charming Wu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: