This idea reminds me of a similar feature in Groovy. I really like this feature
because it allows application developers to let users write Python code that is
very English-like (more than Python already is).
___
Python-ideas mailing list -- python-idea
bit = "\xd8\xa3\xd9\x88\xd9\x87 \xd8\xa8\xd8\xaf\xd9\x8a\xd9\x84
\xd9\x85\xd9\x86 \xd9\x82\xd9\x88\xd9\x84\xd8\xaa\xd9\x8a
\xd9\x88\xd8\xa7\xd9\x87\xd8\xa7"
# here it is a byte but in str
encode_bit = bytes(bit , "latin-1") # i can here say to the computer it is
byte
#then it will print the same w
I stumbled across this:
https://math.stackexchange.com/questions/4172817/complex-floating-point-types,
which discusses implementing complex floating point in polar form (r: unsigned
double, theta: fixed point float), rather than rectangular form (x: signed
double, y: signed double).
Of course,
I spent a couple hours putting this together:
https://github.com/omajoshi/complex_math
It does lazy updating, staying in polar form until an addition, then staying in
rectangular form until the next multiplication.
I implemented Tim Peters' tests (from two emails back):
https://github.com/omaj
> On 23 Feb 2022, at 21:05, one last Day wrote:
>
> bit = "\xd8\xa3\xd9\x88\xd9\x87 \xd8\xa8\xd8\xaf\xd9\x8a\xd9\x84
> \xd9\x85\xd9\x86 \xd9\x82\xd9\x88\xd9\x84\xd8\xaa\xd9\x8a
> \xd9\x88\xd8\xa7\xd9\x87\xd8\xa7"
Is "bit" bidirectional text?
I see what looks like arabic UTF-8 above. Use th
The non-associativity isn't just signed zeros: regular floating point addition
and multiplication of positive numbers is not associative
from math import nextafter
x = nextafter(1.0, 2.0)
print((x+x)+1.0, x+(x+1.0))
x2 = nextafter(1.0, 0.0)
print((x*x2)*x2, x*(x2*x2))
[Dennis Sweeney ]
> The non-associativity isn't just signed zeros: regular floating point
> addition and multiplication of positive numbers is not associative
Yes, but that's shallow, having to do with rounding errors.
In the example I gave, the "inexact" flag never gets set. As far as
754 is con
[Om Joshi ]
> I spent a couple hours putting this together:
> https://github.com/omajoshi/complex_math
>
> It does lazy updating, staying in polar form until an addition, then staying
> in
> rectangular form until the next multiplication.
>
> I implemented Tim Peters' tests (from two emails back)