SlideShare a Scribd company logo
2
Most read
3
Most read
5
Most read
By-
Aakash
Aayush Nigam
Abhinav Porwal
A data type is a class of data objects with a set of
operations for creating
and manipulating them. Examples of elementary data
types: integer, real, character, Boolean, enumeration,
pointer.
 Numeric Data Types
 Enumerations
 Boolean
 Characters
 Character Strings
 Pointers & Programmer-
Constructed Data Objects
 Files & Input-Output
NUMERIC DATA TYPES
• A numeric <data type> is defined by a descriptor that contains four pieces
of information:
• The <data type>'s name:
either INTEGER, SMALLINT, NUMERIC, DECIMAL, FLOAT, REAL or DOUBL
E PRECISION.
• The <data type>'s precision.
• The <data type>'s scale (for exact numeric types).
Whether the <data type>'s precision and scale are expressed in decimal or
binary terms.
Integers Sub-ranges
Floating-
Point Real
Number
Fixed-Point
Real
Number
 INTEGERS
In computer science, an integer is a datum
of integral data type, a data type that
represents some finite subset of the
mathematical integers.
Integral data types may be of different sizes
and may or may not contain negative values.
Cont.
Maximal and minimal
values. The maximum
integer value is
sometimes represented
as a defined constant (eg-
in Pascal, it is the
constant maxint.)
• Arithmetic Operations
• Relational Operations
• Assignment Operations
• Bit Operations
Hardware defined.
 SUBRANGES
A subrange type defines a subset of the
values of a particular type. By using
subrange types, you can easily detect errors
occuring due to unreasonable values of a
variable which shouldn't take values outside
a given boundary. Subrange types can be
defined of type character, integer, in no case
real!
Cont.
Subtype of integer
A sequence of integer
values within some
restricted range
Pascal declaration A: 1..10
means that the variable
A may be assigned integer
Values from 1 through 10.
Smaller storage requirement, better type checking
 FLOATING-POINT REAL NUMBERS
The encoding scheme for floating point
numbers is more complicated than for
fixed point. The basic idea is the same as
used in scientific notation, where a mantissa
is multiplied by ten raised to some
exponent. For instance, 5.4321 × 106,
where 5.4321 is the mantissa and 6 is the
exponent.
Cont.
Minimum and maximal
value
Round-off issues – the
check for equality may fail
due to round-off.
• Arithmetic Operations
• Relational Operations
• Assignment Operations
• Bit Operations
Mantissa – exponent model.
Example: 10.5 = 0.105 x 10,
Mantissa: 105, Exponent:2
 FIXED-POINT REAL NUMBERS
In computing, a fixed-point
number representation is a real data type
for a number that has a fixed number of
digits after (and sometimes also before) the
radix point(after the decimal point '.' in
English decimal notation).
Cont.
Real numbers with
predefined decimal
places
• Arithmetic Operations
• Relational Operations
• Assignment Operations
• Bit Operations
Directly supported by hardware or simulated by software
Involves a complex data structure organization by the
compiler.
Character
Strings
Pointers &
Programmer
Constructed
Data Objects
Files and
Input-Output
TYPES
In computer programming, a string is
traditionally a sequence of characters, either
as a literal constant or as some kind of
variable. The latter may allow its elements
to be mutated and the length changed, or it
may be fixed (after creation).
Cont.
Cont.
• Fixed declared length: storage allocation at
translation time. Strings longer than the
declared length are truncated.
• Variable length to a declared bound: storage
allocation at translation time. An upper bound
for length is set and any string over that length
is truncated.
• Unbound length: storage allocation at run
time. String can be of any length with in the
range.
Cont.
• Concatenation – appending two strings
• Relational – equal(=), less than(<), greater
than(>)
• Substring selection – using positioning
subscripts
• Substring selection – using pattern matching
• Input/output formatting
• Dynamic strings – the string is evaluated at
run time.
• Fixed declared length: A packed vector of
characters
• Variable length to a declared bound: a
descriptor that contains the maximum length
and the current length
• Unbound length: Either a linked storage of
fixed-length data objects or a contiguous array
of characters with dynamic run-time storage
allocation.
Numeric Data Types & Strings

More Related Content

PPTX
Presentation on array
PPTX
Algorithm
PDF
Python programming : Control statements
PPTX
evolution of operating system
PPTX
Data types
PPTX
Data Representation
PPTX
computer Architecture
Presentation on array
Algorithm
Python programming : Control statements
evolution of operating system
Data types
Data Representation
computer Architecture

What's hot (20)

PDF
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
PDF
Strings in python
PPTX
Conditionalstatement
PPTX
Function in C program
PDF
Computer Programming
PPTX
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
PPTX
Language design and translation issues
PPT
Integer Representation
PPTX
Array Introduction One-dimensional array Multidimensional array
PDF
Array data structure
PPT
Problem solving using Computer
PDF
Binary codes
PPTX
concept of Array, 1D & 2D array
PPTX
Data Types and Variables In C Programming
PPTX
Python variables and data types.pptx
PPTX
Pointers in C Programming
PPTX
Fundamentals of Python Programming
PPTX
arrays and pointers
PDF
Data types in python
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Strings in python
Conditionalstatement
Function in C program
Computer Programming
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Language design and translation issues
Integer Representation
Array Introduction One-dimensional array Multidimensional array
Array data structure
Problem solving using Computer
Binary codes
concept of Array, 1D & 2D array
Data Types and Variables In C Programming
Python variables and data types.pptx
Pointers in C Programming
Fundamentals of Python Programming
arrays and pointers
Data types in python
Ad

Similar to Numeric Data Types & Strings (20)

PPTX
Variables&DataTypes.pptx
PPT
Unit 2 Principles of Programming Languages
PPTX
COM1407: Variables and Data Types
PDF
C++ PPT IN NUMERICAL METHOD FOR M.Sc PHYSICS
PPT
Data Handling
PDF
data science with python_UNIT 2_full notes.pdf
PPTX
Basic Concepts of C Language.pptx
PPTX
CS4443 - Modern Programming Language - I Lecture (2)
PPTX
C programming basic concepts of mahi.pptx
PPTX
Constant, variables, data types
PPTX
VB.NET Datatypes.pptx
PPTX
Introduction to R.pptx
PPTX
Introduction to C language programming.pptx
PPT
C++ data types
PPTX
Lesson 7-computer programming case study-FINAL.pptx
PPTX
Lecture 2
PPTX
Data For Datamining
PPTX
Data For Datamining
PDF
PROBLEM SOLVING USING PPSC- UNIT -4.pdf
PPTX
Visual Basic Fundamentals
Variables&DataTypes.pptx
Unit 2 Principles of Programming Languages
COM1407: Variables and Data Types
C++ PPT IN NUMERICAL METHOD FOR M.Sc PHYSICS
Data Handling
data science with python_UNIT 2_full notes.pdf
Basic Concepts of C Language.pptx
CS4443 - Modern Programming Language - I Lecture (2)
C programming basic concepts of mahi.pptx
Constant, variables, data types
VB.NET Datatypes.pptx
Introduction to R.pptx
Introduction to C language programming.pptx
C++ data types
Lesson 7-computer programming case study-FINAL.pptx
Lecture 2
Data For Datamining
Data For Datamining
PROBLEM SOLVING USING PPSC- UNIT -4.pdf
Visual Basic Fundamentals
Ad

Recently uploaded (20)

PDF
Structs to JSON How Go Powers REST APIs.pdf
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
DOCX
573137875-Attendance-Management-System-original
PPTX
Unit 5 BSP.pptxytrrftyyydfyujfttyczcgvcd
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
ETO & MEO Certificate of Competency Questions and Answers
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
The-Looming-Shadow-How-AI-Poses-Dangers-to-Humanity.pptx
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
MET 305 MODULE 1 KTU 2019 SCHEME 25.pptx
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPT
Chapter 6 Design in software Engineeing.ppt
PPTX
Geodesy 1.pptx...............................................
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
PPTX
Sustainable Sites - Green Building Construction
PPTX
Internship_Presentation_Final engineering.pptx
Structs to JSON How Go Powers REST APIs.pdf
Internet of Things (IOT) - A guide to understanding
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
573137875-Attendance-Management-System-original
Unit 5 BSP.pptxytrrftyyydfyujfttyczcgvcd
CYBER-CRIMES AND SECURITY A guide to understanding
ETO & MEO Certificate of Competency Questions and Answers
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
The-Looming-Shadow-How-AI-Poses-Dangers-to-Humanity.pptx
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
MET 305 MODULE 1 KTU 2019 SCHEME 25.pptx
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Chapter 6 Design in software Engineeing.ppt
Geodesy 1.pptx...............................................
CH1 Production IntroductoryConcepts.pptx
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
Sustainable Sites - Green Building Construction
Internship_Presentation_Final engineering.pptx

Numeric Data Types & Strings

  • 2. A data type is a class of data objects with a set of operations for creating and manipulating them. Examples of elementary data types: integer, real, character, Boolean, enumeration, pointer.
  • 3.  Numeric Data Types  Enumerations  Boolean  Characters  Character Strings  Pointers & Programmer- Constructed Data Objects  Files & Input-Output
  • 4. NUMERIC DATA TYPES • A numeric <data type> is defined by a descriptor that contains four pieces of information: • The <data type>'s name: either INTEGER, SMALLINT, NUMERIC, DECIMAL, FLOAT, REAL or DOUBL E PRECISION. • The <data type>'s precision. • The <data type>'s scale (for exact numeric types). Whether the <data type>'s precision and scale are expressed in decimal or binary terms.
  • 6.  INTEGERS In computer science, an integer is a datum of integral data type, a data type that represents some finite subset of the mathematical integers. Integral data types may be of different sizes and may or may not contain negative values. Cont.
  • 7. Maximal and minimal values. The maximum integer value is sometimes represented as a defined constant (eg- in Pascal, it is the constant maxint.) • Arithmetic Operations • Relational Operations • Assignment Operations • Bit Operations Hardware defined.
  • 8.  SUBRANGES A subrange type defines a subset of the values of a particular type. By using subrange types, you can easily detect errors occuring due to unreasonable values of a variable which shouldn't take values outside a given boundary. Subrange types can be defined of type character, integer, in no case real! Cont.
  • 9. Subtype of integer A sequence of integer values within some restricted range Pascal declaration A: 1..10 means that the variable A may be assigned integer Values from 1 through 10. Smaller storage requirement, better type checking
  • 10.  FLOATING-POINT REAL NUMBERS The encoding scheme for floating point numbers is more complicated than for fixed point. The basic idea is the same as used in scientific notation, where a mantissa is multiplied by ten raised to some exponent. For instance, 5.4321 × 106, where 5.4321 is the mantissa and 6 is the exponent. Cont.
  • 11. Minimum and maximal value Round-off issues – the check for equality may fail due to round-off. • Arithmetic Operations • Relational Operations • Assignment Operations • Bit Operations Mantissa – exponent model. Example: 10.5 = 0.105 x 10, Mantissa: 105, Exponent:2
  • 12.  FIXED-POINT REAL NUMBERS In computing, a fixed-point number representation is a real data type for a number that has a fixed number of digits after (and sometimes also before) the radix point(after the decimal point '.' in English decimal notation). Cont.
  • 13. Real numbers with predefined decimal places • Arithmetic Operations • Relational Operations • Assignment Operations • Bit Operations Directly supported by hardware or simulated by software
  • 14. Involves a complex data structure organization by the compiler. Character Strings Pointers & Programmer Constructed Data Objects Files and Input-Output TYPES
  • 15. In computer programming, a string is traditionally a sequence of characters, either as a literal constant or as some kind of variable. The latter may allow its elements to be mutated and the length changed, or it may be fixed (after creation). Cont.
  • 16. Cont. • Fixed declared length: storage allocation at translation time. Strings longer than the declared length are truncated. • Variable length to a declared bound: storage allocation at translation time. An upper bound for length is set and any string over that length is truncated. • Unbound length: storage allocation at run time. String can be of any length with in the range.
  • 17. Cont. • Concatenation – appending two strings • Relational – equal(=), less than(<), greater than(>) • Substring selection – using positioning subscripts • Substring selection – using pattern matching • Input/output formatting • Dynamic strings – the string is evaluated at run time.
  • 18. • Fixed declared length: A packed vector of characters • Variable length to a declared bound: a descriptor that contains the maximum length and the current length • Unbound length: Either a linked storage of fixed-length data objects or a contiguous array of characters with dynamic run-time storage allocation.