C90很长 [英] C90 long long
问题描述
从一篇关于实现C99到C90翻译器的文章...
如何使用至少64位的整数运算,并写入
纯C90?
据我所知C90(标准非常难以捉摸),长整数保证
至少为32位。
那么,人们是否依赖于他们已知的编译器限制,使用笨重的仿真,或者在编写超便携代码时,不会因为64位而烦恼?
-
巴特
On Sun,Apr Apr 2008 15:37:28 +0000,Bartc写道:
从一篇关于实现C99到C90翻译的文章...
如何使用至少64位的整数运算,并在纯C90中写入
?
据我了解C90(标准非常难以捉摸),long int是
保证至少只有32位。
正确。由于long int是最宽的类型,C90不保证任何64位整数类型的存在。
所以,做人们依赖于他们已知的编译器限制,使用笨重的b $ b仿真,或者在编写超便携的
代码时不打扰64位?
人们做任何最适合他们情况的事情。有时,这可能是b $ b涉及重新定义问题以适应32位算术(或浮动 -
点)。有时,这可能是依赖长64位。有时,
可能会使用实现扩展。无论如何,它与C90程序处理复杂算术的方式相同,非常多。
语言和库不提供任何可能性,因此便携式程序
别无选择,只能自行实现。
On Sun,2008年4月6日15:37:28 GMT,Bartc < bc@freeuk.comwrote:
>来自关于实施C99到C90翻译的文章...
如何?使用至少64位的整数运算,并写入纯C90?
据我所知C90(标准非常难以捉摸),长整数保证
在至少32位。
那么,人们是否依赖于他们已知的编译器限制,使用笨重的仿真,或者在编写超便携代码时不打扰64位?
许多人使用大号库模拟非常宽的算术
整数。我认为理查德希思菲尔德把一个放在网上和谷歌
可能会找到你的其他人。
删除del的电子邮件
< blockquote> Barry Schwarz写道:
On Sun,2008年4月6日15:37:28 GMT,Bartc < bc@freeuk.comwrote:
>>从一篇关于实现C99到C90翻译器的文章...
有人如何使用整数至少64位的算术,并写入纯C90?
据我所知C90(标准非常难以捉摸),long int保证至少为32因此,人们是否依赖于他们已知的编译器限制,使用笨重的仿真,或者在编写超便携代码时不打扰64位?
许多人使用大号库模拟非常宽的算术
整数。我认为理查德希思菲尔德把一个放在网上和谷歌
可能会找到你的其他人。
删除del电子邮件
保证软件运行非常缓慢使用
所有CPU都没有。 Heathfield的大数字使用字符
作为基本表示。
-
jacob navia
jacob at jacob point remcomp point fr
logiciels / informatique
http://www.cs.virginia.edu/~lcc-win32
From an article about implementing a C99 to C90 translator...
How does someone use integer arithmetic of at least 64 bits, and write in
pure C90?
As I understand C90 (the standard is very elusive), long int is guaranteed
to be at least 32 bits only.
So, do people rely on their known compiler limits, use clunky emulations, or
do not bother with 64 bits when writing ultra-portable code?
--
Bart
On Sun, 06 Apr 2008 15:37:28 +0000, Bartc wrote:From an article about implementing a C99 to C90 translator...
How does someone use integer arithmetic of at least 64 bits, and write
in pure C90?
As I understand C90 (the standard is very elusive), long int is
guaranteed to be at least 32 bits only.Correct. And as long int is the widest type, C90 does not guarantee the
presence of any 64-bit integer type.
So, do people rely on their known compiler limits, use clunky
emulations, or do not bother with 64 bits when writing ultra-portable
code?People do whatever works best for their situation. Sometimes, that may
involve redefining the problem to fit 32-bit arithmetic (or floating-
point). Sometimes, that may be to rely on long being 64 bits. Sometimes,
that may be to use implementation extensions. In any case, it''s very much
the same as how C90 programs have to deal with complex arithmetic. The
language and library don''t provide any possibility, so portable programs
have no choice but to implement it themselves.
On Sun, 06 Apr 2008 15:37:28 GMT, "Bartc" <bc@freeuk.comwrote:
>From an article about implementing a C99 to C90 translator...
How does someone use integer arithmetic of at least 64 bits, and write in
pure C90?
As I understand C90 (the standard is very elusive), long int is guaranteed
to be at least 32 bits only.
So, do people rely on their known compiler limits, use clunky emulations, or
do not bother with 64 bits when writing ultra-portable code?Many use a "big number library" that simulates arithmetic on very wide
integers. I think Richard Heathfield put one on the web and google
can probably find you others.
Remove del for email
Barry Schwarz wrote:On Sun, 06 Apr 2008 15:37:28 GMT, "Bartc" <bc@freeuk.comwrote:
>>From an article about implementing a C99 to C90 translator...
How does someone use integer arithmetic of at least 64 bits, and write in
pure C90?
As I understand C90 (the standard is very elusive), long int is guaranteed
to be at least 32 bits only.
So, do people rely on their known compiler limits, use clunky emulations, or
do not bother with 64 bits when writing ultra-portable code?
Many use a "big number library" that simulates arithmetic on very wide
integers. I think Richard Heathfield put one on the web and google
can probably find you others.
Remove del for emailThat GUARANTEES that the software will run VERY slowly using
ALL the CPU for nothing. Heathfield''s big numbers use characters
as the base representation.
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
这篇关于C90很长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!