Python论坛  - 讨论区

标题:[python-chinese] -25.5 % 2.25

2005年05月16日 星期一 10:28

Carambo qutr at tjub.com.cn
Mon May 16 10:28:11 HKT 2005

Bruce Who£¬ÄãºÃ

ΪʲôÇóÓàµÄ½á¹û²»ÊÇΨһµÄ£¿ÇëÖ¸½Ì£¡£¡£¡

Carambo £¬ qutr at tjub.com.cn 
2005-5-16 
----- ÊÕµ½ÒÔÏÂÀ´ÐÅÄÚÈÝ ----- 
·¢¼þÈË: Bruce Who 
ÊÕ¼þÈË: python-chinese at lists.python.cn,python-cn-google 
ʱ  ¼ä: 2005-05-16, 10:22:46
Ö÷  Ìâ: Re: [python-chinese] -25.5 % 2.25



  1.5ºÍ-0.74¶¼ÊÇÕýÈ·µÄ½á¹û£¬ÒòΪÇóÓàÊýµÄ½á¹û²»ÊÇΨһµÄ£¬¿´ÄãÔõôȡÁË¡£

======= 2005-05-16 09:00:21 „¢ÀÚ wrote: =======

>-25.5 % 2.25ÔÚpython2.4Ͻá¹ûÊÇ1.5
>µ«¼ÆËãÆ÷Ëã³öÀ´µÄÈ´ÊÇ-0.75
>ÓÃjava¼ÆËã³öÀ´Ò²ÊÇ-0.75
>²»µÃÒªÁ죬Íû¸÷λָ½Ì£¬²»Ê¤¸Ð¼¤£¡ 
>
>_______________________________________________
>python-chinese list
>python-chinese at lists.python.cn
>http://python.cn/mailman/listinfo/python-chinese
>.

= = = = = = = = = = = = = = = = = = = =
      
Best regards,

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Bruce Who
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2005-05-16

_______________________________________________
python-chinese list
python-chinese at lists.python.cn
http://python.cn/mailman/listinfo/python-chinese
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20050516/9ac2b030/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2005年05月16日 星期一 10:32

DengWei salala_mud at 163.com
Mon May 16 10:32:25 HKT 2005

结果是唯一

但 +25.5 和 -25.5 是两个数,所以结果不同。


在 Mon, 16 May 2005 10:28:11 +0800,<"Carambo"<qutr at tjub.com.cn>> 写道:

> Bruce Who,你好
>
> 为什么求余的结果不是唯一的?请指教!!!
>
> Carambo , qutr at tjub.com.cn
> 2005-5-16
> ----- 收到以下来信内容 -----
> 发件人: Bruce Who
> 收件人: python-chinese at lists.python.cn,python-cn-google
> 时  间: 2005-05-16, 10:22:46
> 主  题: Re: [python-chinese] -25.5 % 2.25
>
>
>
>   1.5和-0.74都是正确的结果,因为求余数的结果不是唯一的,看你怎么取了。
>
> ======= 2005-05-16 09:00:21 劉磊 wrote: =======
>
>> -25.5 % 2.25在python2.4下结果是1.5
>> 但计算器算出来的却是-0.75
>> 用java计算出来也是-0.75
>> 不得要领,望各位指教,不胜感激!
>>
>> _______________________________________________
>> python-chinese list
>> python-chinese at lists.python.cn
>> http://python.cn/mailman/listinfo/python-chinese
>> .
>
> = = = = = = = = = = = = = = = = = = = =
> Best regards,
>
>         Bruce Who
>           2005-05-16
>
> _______________________________________________
> python-chinese list
> python-chinese at lists.python.cn
> http://python.cn/mailman/listinfo/python-chinese



-- 
使用 Opera 革命性的电子邮件客户程序: http://www.opera.com/mail/


[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号