![C90很长 C90很长]()
本文介绍了C90很长的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 从一篇关于实现C99到C90翻译器的文章... 如何使用至少64位的整数运算,并写入 纯C90? 据我所知C90(标准非常难以捉摸),长整数保证 至少为32位。 那么,人们是否依赖于他们已知的编译器限制,使用笨重的仿真,或者在编写超便携代码时,不会因为64位而烦恼? - 巴特 解决方案 正确。由于long int是最宽的类型,C90不保证任何64位整数类型的存在。 人们做任何最适合他们情况的事情。有时,这可能是b $ b涉及重新定义问题以适应32位算术(或浮动 - 点)。有时,这可能是依赖长64位。有时, 可能会使用实现扩展。无论如何,它与C90程序处理复杂算术的方式相同,非常多。 语言和库不提供任何可能性,因此便携式程序 别无选择,只能自行实现。 许多人使用大号库模拟非常宽的算术 整数。我认为理查德希思菲尔德把一个放在网上和谷歌 可能会找到你的其他人。 删除del的电子邮件 Barry Schwarz写道: 许多人使用大号库模拟非常宽的算术 整数。我认为理查德希思菲尔德把一个放在网上和谷歌 可能会找到你的其他人。 删除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 inpure C90?As I understand C90 (the standard is very elusive), long int is guaranteedto be at least 32 bits only.So, do people rely on their known compiler limits, use clunky emulations, ordo not bother with 64 bits when writing ultra-portable code?--Bart 解决方案Correct. And as long int is the widest type, C90 does not guarantee thepresence of any 64-bit integer type.People do whatever works best for their situation. Sometimes, that mayinvolve 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 muchthe same as how C90 programs have to deal with complex arithmetic. Thelanguage and library don''t provide any possibility, so portable programshave no choice but to implement it themselves.Many use a "big number library" that simulates arithmetic on very wideintegers. I think Richard Heathfield put one on the web and googlecan probably find you others.Remove del for emailMany use a "big number library" that simulates arithmetic on very wideintegers. I think Richard Heathfield put one on the web and googlecan probably find you others.Remove del for emailThat GUARANTEES that the software will run VERY slowly usingALL the CPU for nothing. Heathfield''s big numbers use charactersas the base representation.--jacob naviajacob at jacob point remcomp point frlogiciels/informatique http://www.cs.virginia.edu/~lcc-win32 这篇关于C90很长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 07-30 15:47