SlideShare a Scribd company logo
1 of 19
Download to read offline
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.
Data types.pdf

More Related Content

Similar to Data types.pdf

Similar to Data types.pdf (20)

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
 
Learn C LANGUAGE at ASIT
Learn C LANGUAGE at ASITLearn C LANGUAGE at ASIT
Learn C LANGUAGE at ASIT
 
Float Data Type in C.pdf
Float Data Type in C.pdfFloat Data Type in C.pdf
Float Data Type in C.pdf
 
Constants, Variables, and Data Types
Constants, Variables, and Data TypesConstants, Variables, and Data Types
Constants, Variables, and Data Types
 
R training2
R training2R training2
R training2
 
5-Lec - Datatypes.ppt
5-Lec - Datatypes.ppt5-Lec - Datatypes.ppt
5-Lec - Datatypes.ppt
 
Chapter 03
Chapter 03Chapter 03
Chapter 03
 
Data types
Data typesData types
Data types
 
chapter 5.ppt
chapter 5.pptchapter 5.ppt
chapter 5.ppt
 

More from Venkateswara Babu Ravipati (12)

EG-Unit-2- Points.pptx
EG-Unit-2- Points.pptxEG-Unit-2- Points.pptx
EG-Unit-2- Points.pptx
 
EG- Unit 1.pptx
EG- Unit 1.pptxEG- Unit 1.pptx
EG- Unit 1.pptx
 
Chapter5.pptx
Chapter5.pptxChapter5.pptx
Chapter5.pptx
 
inputoutput.pptx
inputoutput.pptxinputoutput.pptx
inputoutput.pptx
 
PP ECE A Sec UNIT-1.pptx
PP ECE A Sec UNIT-1.pptxPP ECE A Sec UNIT-1.pptx
PP ECE A Sec UNIT-1.pptx
 
python unit 2.pptx
python unit 2.pptxpython unit 2.pptx
python unit 2.pptx
 
types.pdf
types.pdftypes.pdf
types.pdf
 
6-Python-Recursion PPT.pptx
6-Python-Recursion PPT.pptx6-Python-Recursion PPT.pptx
6-Python-Recursion PPT.pptx
 
cad cam and robotics.pptx
cad cam and robotics.pptxcad cam and robotics.pptx
cad cam and robotics.pptx
 
unit3.pptx
unit3.pptxunit3.pptx
unit3.pptx
 
UNIT 2.pptx
UNIT 2.pptxUNIT 2.pptx
UNIT 2.pptx
 
Le and ne algorithms
Le and ne algorithmsLe and ne algorithms
Le and ne algorithms
 

Recently uploaded

OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 

Recently uploaded (20)

OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 

Data types.pdf

  • 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.