Vous êtes sur la page 1sur 2

Numeric Data | Available Data Types | DEV210x Courseware | edX

9/29/16, 1:39 PM

Microsoft: DEV210x Introduction to C++

Help

Module 2 Data Types in C++ > Available Data Types > Numeric Data
!
Bookmarks

! Bookmark

"

Module 0

"

Module 1
Introducing C++

C++ contains intrinsic data types to store numeric values in your application
code. It's important to remember that these values are binary-based and
not as exible as their base 10 counterparts. For example, in mathematical
terms of a base 10 integer, the denition is a value that is negative innity
to positive innity whole numbers. Modern computers still cannot

# Module 2 Data

Types in C++

Numeric Data Types table. The range does not exceed 3 billion in either
direction.

Available Data
Types
Self-Check

Variables and
Constants
Self-Check

Peer Review
Homework

"

"

"

The byte representation given in that table will give you a hint as to how the
values are stored in the memory and on disk.
NOTE: The type names that start with a __ character are considered non-

Complex Data
Types
Self-Check

represent numbers these large. Take as an example the int type in the

standard types.

Type
Name

By
te
s

Alias

Range

int

signed

2,147,483,648 to 2,147,483,647

Module 3
Control
Statements

unsigned
int

unsigned

0 to 4,294,967,295

__int8

char

-128 to 127

Module 4
Functions and
Objects

unsigned
__int8

unsigned char

0 to 255

__int16

short, short int,


signed short int

32,768 to 32,767

unsigned
__int16

unsigned short,
unsigned short int

0 to 65,535

__int32

signed, signed int, int

2,147,483,648 to 2,147,483,647

unsigned
__int32

unsigned, unsigned
int

0 to 4,294,967,295

__int64

long long, signed long

9,223,372,036,854,775,808 to

End of Course
Evaluation

https://courses.edx.org/courses/course-v1:Microsoft+DEV210x+2T24b8cbe9010af4af97/7a6776e7c1d242228fd3619792f8c49a/?child=first

Page 1 of 2

Numeric Data | Available Data Types | DEV210x Courseware | edX

9/29/16, 1:39 PM

long

9,223,372,036,854,775,807

unsigned
__int64

unsigned long long

0 to 18,446,744,073,709,551,615

short

short int, signed


short int

-32,768 to 32,767

unsigned
short

unsigned short int

0 to 65,535

long

long int, signed long


int

2,147,483,648 to 2,147,483,647

unsigned
long

unsigned long int

0 to 4,294,967,295

long long

none

9,223,372,036,854,775,808 to
9,223,372,036,854,775,807

unsigned
long long

none

0 to 18,446,744,073,709,551,615

oat

none

3.4E +/- 38 (7 digits)

double

none

1.7E +/- 308 (15 digits)

long
double

none

1.7E +/- 308 (15 digits)

All Rights Reserved

2016 edX Inc. All rights reserved except where noted. EdX, Open edX and the edX and Open EdX logos are
registered trademarks or trademarks of edX Inc.

% & ' ( + *

https://courses.edx.org/courses/course-v1:Microsoft+DEV210x+2T24b8cbe9010af4af97/7a6776e7c1d242228fd3619792f8c49a/?child=first

Page 2 of 2