問題描述
剛才我讀到char 是 Java 中唯一的無符號整數原始類型".這是否意味著 char 是 Java 中的整數類型之一?
Just now I read "char is the only unsigned integral primitive type in Java." Does this mean the char is one of the integral types in Java?
和C一樣,最近讀到C類型包括標量類型、函數類型、聯合類型、聚合類型,標量類型包括指針類型和算術類型,然后算術類型包括整數類型和浮點類型,整數類型包括枚舉類型和字符類型.
Same as in C, recently I have read that C types includes scalar types, function types, union types, aggregate types, and scalar types include pointer types and arithmetic types, then arithmetic types include integral types and floating-point types, the integral types include enumerated types and character types.
char 類型真的可以在 Java 和 C 中都歸類為整數嗎?
Can the char type really be categorized as a integer both in Java and C?
推薦答案
是的,char
在它出現的所有流行語言中都是一個整數類型.積分"意味著它的光譜是離散的,并且任何兩個不同值之間的最小差異是1
.與其他整數類型相比,所需的支持值范圍通常非常小.計算機硬件傳統上將整數視為基本數據類型;相比之下,算術浮點類型是一種更新且更復雜的添加.
Yes, a char
is an integral type in all the popular languages in which it appears. "Integral" means that its spectrum is discrete and the smallest difference between any two distinct values is 1
. The required range of supported values is usually quite small compared to that of other integral types. Computer hardware traditionally treats integers as the fundamental data type; by contrast, arithmetic floating-point types are a more recent and more complicated addition.
這篇關于char類型可以歸類為整數嗎?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!