什么是符号和无符号值是什么意思? [英] What does signed and unsigned values mean?

查看:902
本文介绍了什么是符号和无符号值是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是什么签署意思是用C?我有此表显示:

What does signed mean in C? I have this table to show:

这是符号字符 128 +127 所以 128 也是一个正整数,比这可怎么像 +128 +127 还是 128 +127 有不同的含义?我指的是一个preSS 开始ç

This says signed char 128 to +127 so 128 is also a positive integer, than how this can be something like +128 to +127 Or is 128 and +127 have different meanings? I am referring Apress Beginning C book

推荐答案

一个符号整型可以重新present负数;无符号不能。

A signed integer can represent negative numbers; unsigned cannot.

符号整数有不确定的行为,如果他们溢出,同时无符号整数回绕使用模。

Signed integers have undefined behavior if they overflow, while unsigned integers wrap around using modulo.

请注意,该表是不正确。首先,它缺少 - 体征(如-128到+127)。其次,标准不保证这些类型的必须的落在这些范围之内。

Note that that table is incorrect. First off, it's missing the - signs (such as -128 to +127). Second, the standard does not guarantee that those types must fall within those ranges.

这篇关于什么是符号和无符号值是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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