By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,296 Members | 1,457 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,296 IT Pros & Developers. It's quick & easy.

True Division in Python

P: n/a
For a long time,, There has been a discussion of trueFor division
versus integer division in Python.
I myslef prefer that / be used for integer division since almost
always, I want the result of the
division be truncated to integer.

However, today I reviewed the method to be used in Python to get true
division, and this gave
me an idea how true division could be implemented without interferring
with the use of

/ for integer division.

Use / for integer division

single slash is the operator for integer division.

Use ./ for true division.

period slash is the operator for true division.

Kermit < ke****@polaris.net >

Dec 6 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
ke****@polaris.net wrote:
Use ./ for true division.
syntax error...

Dec 7 '06 #2

P: n/a

<ke****@polaris.netwrote in message
news:11**********************@n67g2000cwd.googlegr oups.com...
For a long time,, There has been a discussion of trueFor division
versus integer division in Python.
The discussion and the decision to use // and / were years ago.
I myslef prefer that / be used for integer division since almost
always, I want the result of the
division be truncated to integer.
So use //
However, today I reviewed the method to be used in Python to get true
division, and this gave
me an idea how true division could be implemented without interferring
with the use of
/ for integer division.
Use / for integer division
single slash is the operator for integer division.
Use ./ for true division.
period slash is the operator for true division.
Proposing to use / and ./ instead of // and / is a waste of time. Really

Terry Jan Reedy


Dec 7 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.