Calculator the Right Way
So many people argue on this:
As a programmer: this must be thrown
As a mathematician:
b should considered a multiplicant of
before all of them being divide by
Then why not implement it as the mathematician said? Ok, let's figure out.
How to Use?
Inside this dir, just
Here is something I recommend you to try out:
>>> 9/3(2+1) 1.0 >>> a, b, c, d = 48, 2, 9, 3 >>> a/b(c+d) 2.0 >>> 10(9(8(7(6(5(4(3(2(1))))))))) 3628800 >>> (1+2j)(3-4j) (11+2j) >>> 1 + 1/phi 1.618033988749895 >>> phi(43) 42
What's Differ from Python?
complexare now callable.
Since mathematician often use the same symbol in difference context,
e.g. φ (
phi) can mean for both
golden ratio and
At the 1st glance this seems legit -- just use
phi ** 2 as a number,
phi(50) stands for function calling, -- but since Python is a
1st class function (also function as object), you can pass those functions
as argument everywhere. This means you never figure out
phi as number or function. Also
5(phi) does yield
different value and can cuase much confusion to newbie.
So this concept should not be implement into real-world programming at all.