Prothon与Python整数 [英] Prothon vs. Python integers

查看:158
本文介绍了Prothon与Python整数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为在这种情况下,Python明显优于Prothon。


C:\ temp \prothon\Prothon> python

ActivePython 2.3.2 Build 232(ActiveState Corp.)基于

Python 2.3.2(#49,2003年11月13日,10:34:54)[MSC v.1200 32 bit(Intel)] on

win32

输入help,copyright,credit等等。或许可证或欲了解更多信息。

print 2 ** 65
36893488147419103232

打印2 ** 65 ==(2 ** 65 + 1)
错误

C:\ temp\prothon\Prothon> prothon


Prothon 0.1交互式控制台,Build 532,2004年5月21日(Ctrl-D退出)

打印2 ** 65
3.68935e + 19

打印2 ** 65 ==(2 ** 65 + 1)



True


如果是Prothon是一种为未来十年设计的语言,那么它应该调整正确性和易用性,而不是限制今天的b
硬件。


Paul Prescod

解决方案



" Paul Prescod" < PA ** @ prescod.net>写了

我认为在这种情况下,Python明显优于Prothon。

C:\ temp \prothon \ Prothon> python
Python 2.3.2(#49,2003年11月13日,10:34:54)[MSC v.1200 32位(英特尔)] on
win32
输入help,copyright,credit等等。或许可证或更多信息。

>>>打印2 ** 65 36893488147419103232
>>>打印2 ** 65 ==(2 ** 65 + 1)错误

C:\ temp\prothon\Prothon> prothon

Prothon 0.1交互式控制台, Build 532,2004年5月21日(Ctrl-D退出)
>>>打印2 ** 65 3.68935e + 19
>>>打印2 ** 65 ==(2 ** 65 + 1)


正确

如果Prothon是一种为未来十年设计的语言,那么应该
要求正确性和易用性,而不是限制今天的硬件。




我肯定这不是'Python是唯一更好的地方。


Prothon在解析器中有长整数支持,如果有人想把

麻烦放长目标代码。我没有做任何事情来排除它。我自己也没有看到任何需要它并没有麻烦地把它放进去。

in。


在64位世界中,Longs对我来说似乎是一种不必要的异国情调。肯定是

一旦达到3.7e19,你就处于浮点区域。我无法想象

计算任何高达10 ** 19的东西。


2004年5月24日星期一11:31:08 - 0700,

" Mark Hahn" <毫安** @ prothon.org>写道:

" Paul Prescod" < PA ** @ prescod.net>写了


[snip]

Prothon 0.1 Interactive Console,Build 532,2004年5月21日(Ctrl- D退出)

>>>打印2 ** 65


3.68935e + 19

>>>打印2 ** 65 ==(2 ** 65 + 1)


真正的
如果Prothon是一种为未来十年设计的语言那么
应该调整它的正确性和易用性,而不是今天硬件的限制。



我确定这不是Python的唯一地方更好。
Prothon在解析器中有长整数支持,如果有人想要麻烦地把长目标代码放进去。我没有做任何事情来排除它。我只是没有看到任何需要它自己
并没有麻烦把它放进去。
在64位的情况下,Longs对我来说似乎是一种不必要的异域风情>世界。当你到达3.7e19时,你处于浮点状态。我无法想象计算任何高达10 ** 19的东西。




豆? ;-)


如果Prothon默默地丢失便士(或其他小型商品),会计师(豆类柜台,用贬义的白话)将会不满意

价值货币)一定金额后(里拉和德拉克马春天也要记住
)。


此外,现代的一天加密应用程序可以在256位,512位或更多位(超过1e150)

整数上要求整数/
逻辑运算。


问候,

希瑟


-

Heather Coppersmith

那''不对;那甚至没错。 - Wolfgang Pauli




" Heather Coppersmith" < me@privacy.net>在消息中写道

新闻:m2 ************ @ unique.phony.fqdn ...

在64位的世界里,Longs对我来说似乎是一种不必要的异国风情。当你到达3.7e19时,你处于浮点状态。我无法想象计算任何高达10 ** 19的东西。
豆类? ;-)

如果Prothon在以后默默地丢失便士(或其他小额货币),会计师(亵渎白话,亵渎白话)将会不高兴一定数量(里拉和德拉克马春天也要记住)。




没有经济体可以获得10 ** 19便士的gdp 。

此外,现代加密应用程序可以在256位,512位或更多位(超过1e150)整数上要求整数/
逻辑运算。




Python长期用于那些?我猜即使他们不是某人

可能想要用long来评估算法。


好​​的,我又错了。我会在待办事项清单上加上实施长篇。


I think that in this case, Python is demonstrably better than Prothon.

C:\temp\prothon\Prothon>python
ActivePython 2.3.2 Build 232 (ActiveState Corp.) based on
Python 2.3.2 (#49, Nov 13 2003, 10:34:54) [MSC v.1200 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.

print 2**65 36893488147419103232
print 2**65 == (2**65 + 1) False
C:\temp\prothon\Prothon>prothon

Prothon 0.1 Interactive Console, Build 532, May 21 2004 (Ctrl-D to exit)
print 2** 65 3.68935e+19
print 2**65 == (2**65 + 1)


True

If Prothon is a language designed for the next ten years then it should
be tuned for correctness and ease of use, not for limitations of today''s
hardware.

Paul Prescod

解决方案


"Paul Prescod" <pa**@prescod.net> wrote

I think that in this case, Python is demonstrably better than Prothon.

C:\temp\prothon\Prothon>python
ActivePython 2.3.2 Build 232 (ActiveState Corp.) based on
Python 2.3.2 (#49, Nov 13 2003, 10:34:54) [MSC v.1200 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.

>>> print 2**65 36893488147419103232
>>> print 2**65 == (2**65 + 1) False
C:\temp\prothon\Prothon>prothon

Prothon 0.1 Interactive Console, Build 532, May 21 2004 (Ctrl-D to exit)
>>> print 2** 65 3.68935e+19
>>> print 2**65 == (2**65 + 1)


True

If Prothon is a language designed for the next ten years then it should
be tuned for correctness and ease of use, not for limitations of today''s
hardware.



I''m sure this isn''t the only place Python is better.

Prothon has the long integer support in the parser if anyone wants to take
the trouble to put the long object code in. I did nothing to preclude it. I
just didn''t see any need for it myself and didn''t take the trouble to put it
in.

Longs seemed like a needless exotic kludge to me in the 64-bit world. Surely
once you get to 3.7e19 you are in floating point territory. I can''t imagine
counting anything up to 10**19.


On Mon, 24 May 2004 11:31:08 -0700,
"Mark Hahn" <ma**@prothon.org> wrote:

"Paul Prescod" <pa**@prescod.net> wrote
[ snip ]

Prothon 0.1 Interactive Console, Build 532, May 21 2004 (Ctrl-D to exit)

>>> print 2** 65


3.68935e+19

>>> print 2**65 == (2**65 + 1)


True If Prothon is a language designed for the next ten years then
it should be tuned for correctness and ease of use, not for
limitations of today''s hardware.


I''m sure this isn''t the only place Python is better. Prothon has the long integer support in the parser if anyone
wants to take the trouble to put the long object code in. I did
nothing to preclude it. I just didn''t see any need for it myself
and didn''t take the trouble to put it in. Longs seemed like a needless exotic kludge to me in the 64-bit
world. Surely once you get to 3.7e19 you are in floating point
territory. I can''t imagine counting anything up to 10**19.



Beans? ;-)

Accountants ("bean counters," in the derogatory vernacular) will
be displeased if Prothon silently loses pennies (or other small-
valued currencies) after a certain amount (lira and drachma spring
to mind, too).

Also, modern day cryptography applications can demand integer/
logical operations on 256-, 512-, or more- bit (upwards of 1e150)
integers.

Regards,
Heather

--
Heather Coppersmith
That''s not right; that''s not even wrong. -- Wolfgang Pauli



"Heather Coppersmith" <me@privacy.net> wrote in message
news:m2************@unique.phony.fqdn...

Longs seemed like a needless exotic kludge to me in the 64-bit
world. Surely once you get to 3.7e19 you are in floating point
territory. I can''t imagine counting anything up to 10**19.
Beans? ;-)

Accountants ("bean counters," in the derogatory vernacular) will
be displeased if Prothon silently loses pennies (or other small-
valued currencies) after a certain amount (lira and drachma spring
to mind, too).



No economy is ever going to to have a gdp of 10**19 pennies.
Also, modern day cryptography applications can demand integer/
logical operations on 256-, 512-, or more- bit (upwards of 1e150)
integers.



Are Python longs being used for those? I guess even if they aren''t someone
might want to evaluate algorithms using longs.

Ok, I''m wrong once again. I''ll put implementing longs on the to-do list.


这篇关于Prothon与Python整数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆