Charming Wu created AMBARI-25898:
------------------------------------
Summary: modify Divide Operator from python2 to python3
Key: AMBARI-25898
URL: https://issues.apache.org/jira/browse/AMBARI-25898
Project: Ambari
Issue Type: Sub-task
Components: ambari-server
Affects Versions: 2.7.5
Reporter: Charming Wu
Attachments: image-2023-03-21-14-43-53-490.png
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:
!image-2023-03-21-14-43-53-490.png!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]