通常泛指char、short int、int、long int、long long int這五種類型(包括signed和unsigned)以及_Bool類型。當(dāng)然也包括編譯器作為擴(kuò)展而實(shí)現(xiàn)的某些整型類型。

站在用戶的角度思考問題,與客戶深入溝通,找到博愛網(wǎng)站設(shè)計(jì)與博愛網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗(yàn),讓設(shè)計(jì)與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個(gè)性化、用戶體驗(yàn)好的作品,建站類型包括:成都做網(wǎng)站、成都網(wǎng)站設(shè)計(jì)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、域名注冊、網(wǎng)頁空間、企業(yè)郵箱。業(yè)務(wù)覆蓋博愛地區(qū)。
見C11標(biāo)準(zhǔn):
[6.2.5-4]There are five standard signed integer types, designated as signed char, short int, int, long int, and long long int. (These and other types may be designated in several additional ways, as described in 6.7.2.) There may also be implementation-defined extended signed integer types. The standard and extended signed integer types are collectively called signed integer types.
[6.2.5-6]For each of the signed integer types, there is a corresponding (but different) unsigned integer type (designated with the keyword unsigned) that uses the same amount of storage (including sign information) and has the same alignment requirements. The type _Bool and the unsigned integer types that correspond to the standard signed integer types are the standard unsigned integer types. The unsigned integer types that correspond to the extended signed integer types are the extended unsigned integer types. The standard and extended unsigned integer types are collectively called unsigned integer types.
C語言有以下幾種取整方法:
1、直接賦值給整數(shù)變量。如:
int
i
=
2.5;
或
i
=
(int)
2.5;
這種方法采用的是舍去小數(shù)部分
2、C/C++中的整數(shù)除法運(yùn)算符“/”本身就有取整功能(int
/
int),但是整數(shù)除法對負(fù)數(shù)的取整結(jié)果和使用的C編譯器有關(guān)。
3、使用floor函數(shù)。floor(x)返回的是小于或等于x的最大整數(shù)。如:
floor(2.5)
=
2
floor(-2.5)
=
-3
4、使用ceil函數(shù)。ceil(x)返回的是大于x的最小整數(shù)。如:
ceil(2.5)
=
3
ceil(-2.5)
=
-2
floor()是向負(fù)無窮大舍入,floor(-2.5)
=
-3;ceil()是向正無窮大舍入,ceil(-2.5)
=
-2。
這兩個(gè)函數(shù)在VC++中也能使用,但使用時(shí)需要包含math.h文件。要在程序的開始添加如下代碼:
#include
math.h
int a = 10;這是定義一個(gè)變量a
int Sort()
{
return 0;
}
這是返回整型數(shù)的函數(shù)
當(dāng)前題目:c語言函數(shù)值整型 c語言整型除以整型
本文路徑:http://chinadenli.net/article38/hpgdpp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供外貿(mào)網(wǎng)站建設(shè)、移動(dòng)網(wǎng)站建設(shè)、用戶體驗(yàn)、建站公司、網(wǎng)站營銷、企業(yè)建站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)