From: "Paul Gilmartin" <0000000433f07816-dmarc-requ...@listserv.ua.edu>
Sent: Sunday, September 06, 2020 1:33 PM


On Sat, 5 Sep 2020 08:13:42 +1000, Robin Vowels wrote:

As for writing formulas, I prefer to follow a well-known formula, thus:

volume = 4/3 * 3.14159 * radius**3

Beware!  Than might left-associate as:
   volume = ( 4/3 ) * 3.14159 * radius**3

Under the left-to-right rule, that's precisely how the
original exression would be interpreted.
The paretheses are redundany.

... and the quotient of integers, 4/3, is 1.

No it isn't.
   4/3 yields 1.33333333333333

However, if I'm interested in efficiency, I'd prefer

volume = 4 * 3.14159E0 / 3 * radius**3

... (and correct.)

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to