整数值的统计

编程入门 行业动态 更新时间:2024-10-08 02:27:39
本文介绍了整数值的统计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

你好在一起! 我正在寻找关于标准的集合中整数值范围的统计数据 c-programs。 我特别感兴趣的是 整数的分配比率,其值为(un)16位或32位比特大小。 有没有人接触过类似的东西? 再见, Stefan

Hello together! I''m searching for a statistic about the value ranges of integers in a set of "standard" c-programs. I''m specifically interested in the avarage ratio of assignments etc. of integers where the value is either of (un)signed 16 bit or 32 bit size. Has anybody ever been in contact with something similar? Bye, Stefan

推荐答案

" Stefan Wallentowitz" < ST **** @ wallentowitz.de>写了 "Stefan Wallentowitz" <st****@wallentowitz.de> wrote 我正在寻找关于标准集合中整数值范围的统计数据。 c-programs。我特别感兴趣的是整数的赋值等的平均比例,其值为(un)16位或32位大小。有没有人接触过类似的东西? I''m searching for a statistic about the value ranges of integers in a set of "standard" c-programs. I''m specifically interested in the avarage ratio of assignments etc. of integers where the value is either of (un)signed 16 bit or 32 bit size. Has anybody ever been in contact with something similar?

不会。确切地定义你的意思是相当棘手的。 例如,一个变量i的范围在0和N-1之间的循环, 是一个非常常见的结构。但计数变量通常不会超过几个机器周期。另一方面,N可能会在程序的生命周期内保持其价值。 但是如果循环在子程序中,变量N可以传递给那个 例程,复制自Nemployees。数据结构的成员。那么N 现在算作一个或两个整数? 另外,由于C语义,我实际上将在结尾处设置为N for循环。但是,我可能永远不会在循环之外访问。 那么我是否取值N?

No. It will be rather tricky to define exactly what you mean. For instance, a loop in which a variable, i, takes range between 0 and N-1, is an extremely common construct. However the counting variable usually isn''t held for more than a few machine cycles. N, on the other hand, may well keep its value for the life of the program. However if the loop is in a subroutine, variable N may be passed to that routine, copied from a "Nemployees" member of a data structure. So does N now count as one or two integers? Also, because of C semantics, i will actually be set to N at the end of the for loop. Probably, however, i will never be accessed outside of the loop. So has i taken the value N, or not?

Am Sat ,2005年12月10日21:25:38 +0000 schrieb Malcolm: 嗨! Am Sat, 10 Dec 2005 21:25:38 +0000 schrieb Malcolm: Hi! 没有。确切定义真的很棘手你是什​​么意思。 好​​吧,我觉得它可能有点不可思议。 另外,由于C语义,我实际上会在< for循环。但是,可能永远不会在循环之外访问。那么我是否取值N? No. It will be rather tricky to define exactly what you mean. Ok, I thought it might be a bit unexact. Also, because of C semantics, i will actually be set to N at the end of the for loop. Probably, however, i will never be accessed outside of the loop. So has i taken the value N, or not?

是的,N就是其中之一。但我也初始化了。实际上我对 寄存器中加载的公共整数范围的比率感兴趣。几个例子: a = 1,a = b + 4,a = 0x0feff0c4等 它与编译器优化有关并且有趣多少 指令平均保存,例如当16位有符号整数的出现率很高时,优化会带来更多的成功。但是一些 的测量数据会很棒。 我也知道存在机器依赖性,但是我设想一些 的整体数据来自于关于c-code的更抽象的观点。 Greets, Stefan

Yes, N is one of it. But the initialisation of i also. In fact I''m interested in the ratio of common integer ranges being loaded in registers. Several examples: a=1, a=b+4, a=0x0feff0c4 etc. It is related to a compiler optimization and it is interesting how much instructions are in average saved, e.g. when theres a high occurence-rate of 16 bit signed integers, the optimization brings more success. But some measurement data would be great. I also know that there is a machine dependency, but I envision some overall data from a more abstract view on c-code. Greets, Stefan

Stefan Wallentowitz写道: Stefan Wallentowitz wrote: 我正在搜索关于标准集合中整数值范围的统计数据。 C-程序。 您可能需要自己生成。 我特别感兴趣的是整数的分配等的平均比例该值可以是(未)签名的16位或32位大小。 I''m searching for a statistic about the value ranges of integers in a set of "standard" c-programs. You will probably have to generate your own. I''m specifically interested in the avarage ratio of assignments etc. of integers where the value is either of (un)signed 16 bit or 32 bit size.

您需要更准确地了解您的需求。 整数的赋值比率,其值为 (un)16位或32位大小。 这意味着你想要计算整数赋值的数量 执行的值,其中该值恰好有16个重要位,而且确切地说是b / b $ 32 b 32个有效位并计算它们的比率? 你想知道16位 与32位整数类型的赋值语句有多少而不考虑值而不考虑 执行次数?或其他什么? - Thad

You need to be more precise about what you need. "ratio of assignments etc. of integers where the value is either of (un)signed 16 bit or 32 bit size." Does that mean you want to count the number of integer assignments executed in which the value has exactly 16 sigificant bits and exactly 32 significant bits and compute their ratio? Do you want to know how many assignment statements are made to 16-bit vs. 32-bit integer types without regard to value and without regard to the number of times executed? Or something else? -- Thad

更多推荐

整数值的统计

本文发布于:2023-11-30 06:36:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1649041.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:整数

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!