SlideShare a Scribd company logo
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

What's hot

Passing an Array to a Function (ICT Programming)
Passing an Array to a Function (ICT Programming)Passing an Array to a Function (ICT Programming)
Passing an Array to a Function (ICT Programming)
Fatima Kate Tanay
 

What's hot (20)

Constant, variables, data types
Constant, variables, data typesConstant, variables, data types
Constant, variables, data types
 
Relational operators
Relational operatorsRelational operators
Relational operators
 
Unit 3. Input and Output
Unit 3. Input and OutputUnit 3. Input and Output
Unit 3. Input and Output
 
Python programming : Standard Input and Output
Python programming : Standard Input and OutputPython programming : Standard Input and Output
Python programming : Standard Input and Output
 
Ascii codes
Ascii codesAscii codes
Ascii codes
 
Lesson 02 python keywords and identifiers
Lesson 02   python keywords and identifiersLesson 02   python keywords and identifiers
Lesson 02 python keywords and identifiers
 
Programming in c Arrays
Programming in c ArraysProgramming in c Arrays
Programming in c Arrays
 
Strings in C
Strings in CStrings in C
Strings in C
 
Python Functions
Python   FunctionsPython   Functions
Python Functions
 
Constants in C Programming
Constants in C ProgrammingConstants in C Programming
Constants in C Programming
 
Break and continue
Break and continueBreak and continue
Break and continue
 
Basics of pointer, pointer expressions, pointer to pointer and pointer in fun...
Basics of pointer, pointer expressions, pointer to pointer and pointer in fun...Basics of pointer, pointer expressions, pointer to pointer and pointer in fun...
Basics of pointer, pointer expressions, pointer to pointer and pointer in fun...
 
File handling in c
File handling in cFile handling in c
File handling in c
 
Looping statement in python
Looping statement in pythonLooping statement in python
Looping statement in python
 
Data types in C
Data types in CData types in C
Data types in C
 
Passing an Array to a Function (ICT Programming)
Passing an Array to a Function (ICT Programming)Passing an Array to a Function (ICT Programming)
Passing an Array to a Function (ICT Programming)
 
Strings
StringsStrings
Strings
 
Operators in python
Operators in pythonOperators in python
Operators in python
 
Applications of stack
Applications of stackApplications of stack
Applications of stack
 
Functions in python slide share
Functions in python slide shareFunctions in python slide share
Functions in python slide share
 

Similar to Numeric Data Types & Strings

Unit 2 Principles of Programming Languages
Unit 2 Principles of Programming LanguagesUnit 2 Principles of Programming Languages
Unit 2 Principles of Programming Languages
Vasavi College of Engg
 
data science with python_UNIT 2_full notes.pdf
data science with python_UNIT 2_full notes.pdfdata science with python_UNIT 2_full notes.pdf
data science with python_UNIT 2_full notes.pdf
mukeshgarg02
 
Structure of c_program_to_input_output
Structure of c_program_to_input_outputStructure of c_program_to_input_output
Structure of c_program_to_input_output
Anil Dutt
 

Similar to Numeric Data Types & Strings (20)

Variables&DataTypes.pptx
Variables&DataTypes.pptxVariables&DataTypes.pptx
Variables&DataTypes.pptx
 
Unit 2 Principles of Programming Languages
Unit 2 Principles of Programming LanguagesUnit 2 Principles of Programming Languages
Unit 2 Principles of Programming Languages
 
COM1407: Variables and Data Types
COM1407: Variables and Data Types COM1407: Variables and Data Types
COM1407: Variables and Data Types
 
Data Handling
Data HandlingData Handling
Data Handling
 
data science with python_UNIT 2_full notes.pdf
data science with python_UNIT 2_full notes.pdfdata science with python_UNIT 2_full notes.pdf
data science with python_UNIT 2_full notes.pdf
 
Basic Concepts of C Language.pptx
Basic Concepts of C Language.pptxBasic Concepts of C Language.pptx
Basic Concepts of C Language.pptx
 
CS4443 - Modern Programming Language - I Lecture (2)
CS4443 - Modern Programming Language - I  Lecture (2)CS4443 - Modern Programming Language - I  Lecture (2)
CS4443 - Modern Programming Language - I Lecture (2)
 
C programming basic concepts of mahi.pptx
C programming basic concepts of mahi.pptxC programming basic concepts of mahi.pptx
C programming basic concepts of mahi.pptx
 
VB.NET Datatypes.pptx
VB.NET Datatypes.pptxVB.NET Datatypes.pptx
VB.NET Datatypes.pptx
 
Introduction to R.pptx
Introduction to R.pptxIntroduction to R.pptx
Introduction to R.pptx
 
C++ data types
C++ data typesC++ data types
C++ data types
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Data For Datamining
Data For DataminingData For Datamining
Data For Datamining
 
Data For Datamining
Data For DataminingData For Datamining
Data For Datamining
 
Visual Basic Fundamentals
Visual Basic FundamentalsVisual Basic Fundamentals
Visual Basic Fundamentals
 
CSC111-Chap_02.pdf
CSC111-Chap_02.pdfCSC111-Chap_02.pdf
CSC111-Chap_02.pdf
 
Python
PythonPython
Python
 
Data structure
Data structureData structure
Data structure
 
Structure of c_program_to_input_output
Structure of c_program_to_input_outputStructure of c_program_to_input_output
Structure of c_program_to_input_output
 
arrays and pointers
arrays and pointersarrays and pointers
arrays and pointers
 

Recently uploaded

CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Digital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfDigital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdf
AbrahamGadissa
 
Hall booking system project report .pdf
Hall booking system project report  .pdfHall booking system project report  .pdf
Hall booking system project report .pdf
Kamal Acharya
 
Fruit shop management system project report.pdf
Fruit shop management system project report.pdfFruit shop management system project report.pdf
Fruit shop management system project report.pdf
Kamal Acharya
 

Recently uploaded (20)

Online resume builder management system project report.pdf
Online resume builder management system project report.pdfOnline resume builder management system project report.pdf
Online resume builder management system project report.pdf
 
Construction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptxConstruction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptx
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Toll tax management system project report..pdf
Toll tax management system project report..pdfToll tax management system project report..pdf
Toll tax management system project report..pdf
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
fundamentals of drawing and isometric and orthographic projection
fundamentals of drawing and isometric and orthographic projectionfundamentals of drawing and isometric and orthographic projection
fundamentals of drawing and isometric and orthographic projection
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
Digital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfDigital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdf
 
fluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answerfluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answer
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
Hall booking system project report .pdf
Hall booking system project report  .pdfHall booking system project report  .pdf
Hall booking system project report .pdf
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
Fruit shop management system project report.pdf
Fruit shop management system project report.pdfFruit shop management system project report.pdf
Fruit shop management system project report.pdf
 
Explosives Industry manufacturing process.pdf
Explosives Industry manufacturing process.pdfExplosives Industry manufacturing process.pdf
Explosives Industry manufacturing process.pdf
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
shape functions of 1D and 2 D rectangular elements.pptx
shape functions of 1D and 2 D rectangular elements.pptxshape functions of 1D and 2 D rectangular elements.pptx
shape functions of 1D and 2 D rectangular elements.pptx
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
 

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.