Lecture-17(data types-dim)

Lecture-17(data types-dim) - Data Types Variable Scope Data...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Data Types & Variable Scope
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Data Types Data of interest to engineers can be of the following type: Numbers Integer numbers Real numbers Characters (String) Logical (Boolean) 3 = n Variable name Integer Data Type 0 . 3 = x Variable name Real Data Type
Background image of page 2
Data Types Byte: The Byte data type is an 8-bit variable which can store value from 0 to 255 . This data type is very useful for storing binary data. Integer Data Type 1. Integer: The Integer data type is a 16-bit (or 2 bytes of allocated memory) number which can range from -32768 to 32767 . Integers should be used when you are working with values that can not contain fractional numbers. 2. Long: The Long data type is a 32-bit number (or 4 bytes of allocated memory) which can range from -2,147,483,648 to 2,147,483,647 . e.g. if in your calculation you have the number of seconds in a day, then that value is 86400 > 32767 and so you would exceed the range of the Integer Type and would have to specify Long Data Type.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Data Types (Cont’d) Real Data Type 1. Single: The Single data type is a 32-bit (or 4 Bytes of allocated memory) number ranging from -3.402823 e 38 to -1.401298 e -45 and from 1.401298 e -45 to 3.402823 e 38 for positive values. 1 bit is used for the sign, 8 for the exponent and 23 for the
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/27/2008 for the course PGE 310f taught by Professor Srinivasan during the Spring '08 term at University of Texas.

Page1 / 11

Lecture-17(data types-dim) - Data Types Variable Scope Data...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online