You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ambari.apache.org by "Charming Wu (Jira)" <ji...@apache.org> on 2023/03/21 06:46:00 UTC
[jira] [Updated] (AMBARI-25898) modify Divide Operator from python2 to python3
[ https://issues.apache.org/jira/browse/AMBARI-25898?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Charming Wu updated AMBARI-25898:
---------------------------------
Environment:
{*}Ambari:{*}Ambari-2.7.5
*OS:* OpenEuler-22.03
*Python:* Python 3.9.9
> 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
> Environment: {*}Ambari:{*}Ambari-2.7.5
> *OS:* OpenEuler-22.03
> *Python:* Python 3.9.9
> Reporter: Charming Wu
> Priority: Major
> Labels: DivideOperator, python2, python3
> 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: issues-unsubscribe@ambari.apache.org
For additional commands, e-mail: issues-help@ambari.apache.org