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.

------------------&nbsp;原始邮件&nbsp;------------------
发件人:                                                                            
                                            "Python tracker"                    
                                                                
<rep...@bugs.python.org&gt;;
发送时间:&nbsp;2021年5月19日(星期三) 凌晨0:41
收件人:&nbsp;"坏蛋"<792641...@qq.com&gt;;

主题:&nbsp;[issue44171] Cython cannot compile 'a = 5/6' and return 'a = 0'

Eric V. Smith <e...@trueblade.com&gt; 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&gt;
<https://bugs.python.org/issue44171&gt;
_______________________________________

----------
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

Reply via email to