算术类型的分类 [英] Classification of arithmetic types

查看:143
本文介绍了算术类型的分类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如Richard Bos正确地指出的那样,我已经在我的分类中留下了类似C99类型Complex和boolean的
类型。这是一个新的

分类。 Plauger和Brody的分类中没有提到这些,可能是因为他们的工作早于
C99。由于文献中没有这个例子

(我知道)请看一下。


谢谢

3.1 .1算术类型

3.1.1.1整数类型

3.1.1.1.1特定整数类型

3.1.1.1.1.1布尔类型

3.1.1.1.1.2 char(签名/未签名)

3.1.1.1.1.3 short(签名未签名)

3.1.1.1.1.4 int(签名/未签名)

3.1.1.1.1.5长(签名/未签名)

3.1.1.1.1.6 long long(签名/未签名)

3.1.1.1.2位域(有符号/无符号)

3.1.1.1.3枚举类型

3.1.1.2浮动类型

3.1。 1.2.1真实类型

3.1.1.2.1.1浮动

3.1.1.2.1.2双倍

3.1.1.2.1.3 long double

3.1.1.2.4复杂类型

3.1.1.2.4.1浮动复合物

3.1.1.2.4.2复合物

3.1.1.2.4.2 long double Complex


我将算术类型定义为定义4个操作的算法类型。

这将它们从指针类型中分离出来,其中定义了加法和

减法但不是乘法/除法。


这是正确的吗?

jacob

解决方案

jacob navia写道:


正如Richard Bos正确指出的那样,我在分类中留下了类似C99类型Complex和boolean的
类型。这是一个新的

分类。 Plauger和Brody的分类中没有提到这些,可能是因为他们的工作早于
C99。由于文献中没有这个例子

(我知道)请看看。


谢谢


3.1.1算术类型

3.1.1.1整数类型

3.1.1.1.1特定整数类型

3.1.1.1.1.1布尔类型

3.1.1.1.1.2字符(有符号/无符号)



另外普通旧字符,第三种类型与另一种不同

两种(即使它的行为与其中一种相同)。


3.1.1.1.1.3 short (签名未签名)

3.1.1.1.1.4 int(签名/未签名)

3.1.1.1.1.5长(签名/未签名)

3.1.1.1.1.6 long long(签名/未签名)



如何wchar_t,size_t,ptrdiff_t,sig_atomic_t,wint_t,

和< stdint.htypes?


3.1.1.1.2位域(有符号/无符号)

3.1.1.1.3枚举类型

3.1.1.2浮动类型

3.1.1.2.1实物类型

3.1.1.2.1.1浮动

3.1。 1.2.1.2 double

3.1.1.2.1.3 long double



float_t和double_t?


3.1.1.2.4复杂类型

3.1.1.2.4.1浮动综合体

3.1.1.2.4.2双复数

3.1.1.2.4.2长双复数



time_t,clock_t,wctrans_t和wctype_t很难分类。


-

Eric Sosman
es*****@acm-dot-org.inva 盖子


Eric Sosmanaécrit:


此外,普通老字号,第三种类型与另一种不同

两种(尽管它的行为与其中一种相同)。

wchar_t,size_t,ptrdiff_t,sig_atomic_t,wint_t,
和< stdint.htypes?

time_t,clock_t,wctrans_t和wctype_t很难分类。


据我了解这些东西,所有这些都是按照上面列举中的原始类型之一来定义的。

例如,在许多实现中,size_t是unsigned long,

或time_t是long long,或者clock_t是int等等。


它们是定义的派生类型更原始的类型。


这同样适用于图表(" plain" char),因为它被定义为

作为unsigned或signed char ,这意味着它不是另一种基本的

类型,而是其中一种字符类型的同义词。


jacob naviaaécrit:

这同样适用于图表(普通) char)



不是图表但是char当然。对不起。


As Richard Bos rightly pointed out, I had left in my classification
of types the C99 types Complex and boolean. Here is a new
classification. Those are not mentioned in the classification
of Plauger and Brody, probably because their work predates
C99. Since there are no examples of this in the literature
(known to me) please take a look.

Thanks
3.1.1 Arithmetic types
3.1.1.1 Integer types
3.1.1.1.1 Specific integer types
3.1.1.1.1.1 boolean type
3.1.1.1.1.2 char (signed/unsigned)
3.1.1.1.1.3 short (signed unsigned)
3.1.1.1.1.4 int (signed/unsigned)
3.1.1.1.1.5 long (signed/unsigned)
3.1.1.1.1.6 long long (signed/unsigned)
3.1.1.1.2 Bitfields (signed/unsigned)
3.1.1.1.3 Enumeration types
3.1.1.2 Floating types
3.1.1.2.1 Real types
3.1.1.2.1.1 float
3.1.1.2.1.2 double
3.1.1.2.1.3 long double
3.1.1.2.4 Complex types
3.1.1.2.4.1 float Complex
3.1.1.2.4.2 double Complex
3.1.1.2.4.2 long double Complex

I would define arithmetic types as those that define the 4 operations.
This distiguishes them from pointer types where addition and
subtraction are defined but not multiplication/division.

Is that correct?

jacob

解决方案

jacob navia wrote:

As Richard Bos rightly pointed out, I had left in my classification
of types the C99 types Complex and boolean. Here is a new
classification. Those are not mentioned in the classification
of Plauger and Brody, probably because their work predates
C99. Since there are no examples of this in the literature
(known to me) please take a look.

Thanks
3.1.1 Arithmetic types
3.1.1.1 Integer types
3.1.1.1.1 Specific integer types
3.1.1.1.1.1 boolean type
3.1.1.1.1.2 char (signed/unsigned)

Also "plain old char," a third type distinct from the other
two (even though it behaves identically to one of them).

3.1.1.1.1.3 short (signed unsigned)
3.1.1.1.1.4 int (signed/unsigned)
3.1.1.1.1.5 long (signed/unsigned)
3.1.1.1.1.6 long long (signed/unsigned)

How about wchar_t, size_t, ptrdiff_t, sig_atomic_t, wint_t,
and the <stdint.htypes?

3.1.1.1.2 Bitfields (signed/unsigned)
3.1.1.1.3 Enumeration types
3.1.1.2 Floating types
3.1.1.2.1 Real types
3.1.1.2.1.1 float
3.1.1.2.1.2 double
3.1.1.2.1.3 long double

float_t and double_t?

3.1.1.2.4 Complex types
3.1.1.2.4.1 float Complex
3.1.1.2.4.2 double Complex
3.1.1.2.4.2 long double Complex

time_t, clock_t, wctrans_t, and wctype_t are difficult to
categorize.

--
Eric Sosman
es*****@acm-dot-org.invalid


Eric Sosman a écrit :

Also "plain old char," a third type distinct from the other
two (even though it behaves identically to one of them).
How about wchar_t, size_t, ptrdiff_t, sig_atomic_t, wint_t,
and the <stdint.htypes?
time_t, clock_t, wctrans_t, and wctype_t are difficult to
categorize.

As far as I understood this stuff, all those are defined in terms of
one of the primitive types in the enumeration above.
For instance, in many implementations size_t is unsigned long,
or time_t is long long, or clock_t is int, etc etc.

They are derived types defined in terms of a more primitive type.

The same applies to chart ("plain" char) since it is defined either
as unsigned or signed char, what means it is not another basic
type but a synonym for one of the char types.


jacob navia a écrit :

The same applies to chart ("plain" char)

Not "chart" but "char" of course. Excuse me.


这篇关于算术类型的分类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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