SlideShare uma empresa Scribd logo
1 de 19
Baixar para ler 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

Mais conteúdo relacionado

Semelhante a Data types.pdf

Semelhante a 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
 

Mais de 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
 

Último

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
 
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
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
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
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
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
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
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
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction managementMariconPadriquez1
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 

Último (20)

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
 
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
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 
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
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
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
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
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...
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
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
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction management
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 

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.