Yao Zhang <792641...@qq.com> added the comment:
Thank you for your patient answer, but I still don't understand.I have uploaded
my file (*.py).I hope you can solve my problem. I want 'a=5/6' to return 'a=
0.833333333333333...... 'after compilation.
------------------ 原始邮件 ------------------
发件人:
"Python tracker"
<rep...@bugs.python.org>;
发送时间: 2021年5月19日(星期三) 凌晨0:41
收件人: "坏蛋"<792641...@qq.com>;
主题: [issue44171] Cython cannot compile 'a = 5/6' and return 'a = 0'
Eric V. Smith <e...@trueblade.com> added the comment:
Please report this to the Cython bug tracker:
https://github.com/cython/cython/issues/
When you do that, you'll want to show the actual code you're having a problem
with. You're using both "//" and "/" here. As Pablo said, you're probably
having a problem with integer division ("//").
----------
_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44171>
_______________________________________
----------
Added file: https://bugs.python.org/file50050/problem.py
_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44171>
_______________________________________
#:The following code outputs a *. Pyd file after being compiled in Cython
a = 5 / 6
print(a) #:return :a = 0
b = 1
a = 5 / 6 + b #: return : a = 0
print(a)
a = 5
a = a / 6 #:return : a = 0.8333333333333334
print(a)
#:After the *.pyd file is generated, run the following code
'''
>> import problem
>> 0
>> 0
>> 0.8333333333333334
'''
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com