On Tue, Apr 7, 2009 at 8:59 PM, Alexandru Moșoi <brtzsnr at gmail.com> wrote: > Not necessarily. For example C/C++ doesn't define the order of the > operations inside an expression (and AFAIK neither Python) and > therefore folding 2 * 3 is OK whether b is an integer or an arbitrary > object with mul operator overloaded. Moreover one would expect * to be > associative and commutative (take a look at Python strings); if a * 2 > * 3 returns a different result from a * 6 I will find it very > surprising and probably reject such code. Multiplication is not associative for floats: >>> a = 0.1 >>> a*3*5 1.5000000000000002 >>> a*(3*5) 1.5 Fredrik
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4