Decimal form. Fw.d Exponential form Ew.d Ew.dEe Scientific form ESw.d ESw.dEe Engineering form ENw.d ENw.dEe Lw. Horizontal

Size: px
Start display at page:

Download "Decimal form. Fw.d Exponential form Ew.d Ew.dEe Scientific form ESw.d ESw.dEe Engineering form ENw.d ENw.dEe Lw. Horizontal"

Transcription

1 Fortran Formats The tedious part of using Fortran format is to master many format edit descriptors. Each edit descriptor tells the system how to handle certain type of values or activity. Each value requires some positions. For example, an integer of four digits requires at least four positions to print. Therefore, the number of positions to be used is the most important information in an edit descriptor. We shall use the following convention of symbols: w: the number of positions to be used m: the minimum number of positions to be used d: the number of digits to the right of the decimal point e: the number of digits in the exponent part Although we may print a number using as many positions as you want, this is only for input/output. This number of positions is not the precision (or the number of significant digits) of that number. To be more precisely, computers normally can store real numbers up to seven significant digits. This is the precision of real numbers. However, we can print a real number using 50 positions in which 25 positions are for the fraction part. This is only a way of describing the appearance and does not change the precision of real numbers. The following are the editor descriptors: Purpose Edit Descriptors Reading/writing INTEGERs Iw Iw.m Reading/writing REALs Reading/writing LOGICALs Decimal form Fw.d Exponential form Ew.d Ew.dEe Scientific form ESw.d ESw.dEe Engineering form ENw.d ENw.dEe Lw Reading/writing CHARACTERs A Aw Positioning Others Horizontal nx Tabbing Tc TLc and TRc Vertical / Grouping r(...) Format Scanning Control : Sign Control S, SP and SS Blank Control BN and BZ Most edit descriptors can be repeated and several edit descriptors can be grouped into a group. 1/12

2 INTEGER Output: The I Descriptor The Iw and Iw.m descriptors are for INTEGER output. The general form of these descriptors are as follows: The meaning of r, w and m are: riw and riw.m I is for INTEGER w is the width of field, which indicates that an integer should be printed with w positions. m indicates that at least m positions (of the w positions) must contain digits. If the number to be printed has fewer than m digits, leading 0s are filled. If the number to be output has more than m digits, m is ignored and in this case Iw.m is equivalent to Iw. Note that w must be positive and larger than or equal to m. It is interesting to note that m can be zero! That is, no digits should be printed. In this case, if the number to be printed is non-zero, it will be printed as if Iw is used. However, if the number is zero, all w positions will be filled with spaces! r is the repetition indicator, which gives the number of times the edit descriptor should be repeated. For example, 3I5.3 is equivalent to I5.3, I5.3, I5.3. The sign of a number also needs one position. Thus, if -234 is printed, w must be larger than or equal to 4. The sign of a positive number is not printed. What if the number of positions is less than the number of digits plus the sign? In other words, what if a value of is printed with I3? Three positions are not enough to print the value of five digits. In this case, traditionally, all w positions are filled with *'s. Therefore, if you see a sequence of asterisks, you know your edit descriptor does not have enough length to print a number. Examples Let us look at the following example. There are three INTEGER variables a, b and c with values 123, -123 and , respectively. In the following table, the WRITE statements are shown at the left and their corresponding output, all using five positions, are shown at the right. 2/12

3 The first line uses (I5) to print the value of 123. Thus, digits 1, 2 and 3 appear at the right end and two leading spaces are filled. The second line uses (I5.2) to print 123. This means of the five positions, two positions must contain digits. Since the value 123 has already had 3 digits. Therefore,.2 is ignored and the result is the same as that of the first line. The third line uses (I5.4) to print 123. Since m = 4, four positions must be filled with digits. Since 123 has only three digits, a leading 0 must be inserted. Thus, in the output, the five positions contain a space, 0, 1, 2 and 3. The fourth line uses I5.5 and therefore forces two 0s to be inserted. The fifth line uses (I5) to print Since the number is negative, a minus sign is printed. The sixth line produces the same result as that of the fifth line. The seventh line tells us that if leading zeros must be inserted, they are inserted between the minus sign and the number. The eighth line uses (I5.5) to print This is not a good edit descriptor. I5.5 means to print a number using five positions and all five positions must be filled with digits. If the number is positive, there is no problem as shown in the fourth line. However, if the number is negative, there will be no position for the minus sign. As a result, all five positions are filled with asterisks, indicating a problem has occurred. The last line uses I5.2 to print The number has six digits and the number of positions to print this number is five. Thus, the given number cannot be printed completely and all five positions are filled with asterisks. Consider the following example. The WRITE statement has three INTEGER variables and consequently the format must also have three I edit descriptors, one for each variable. INTEGER :: a = 3, b = -5, c = 128 WRITE(*,"(3I4.2)") a, b, c The edit descriptor is 3I4.2 and the format is equivalent to (I4.2,I4.2,I4.2) because the repetition indicator is 3. Therefore, each of the three INTEGER variables is printed with I4.2. Based on the discussion earlier, the result is the following: 3/12

4 REAL Output: The F Descriptor The Fw.d descriptor is for REAL output. The general form is: The meaning of r, w and d are: rfw.d F is for REAL w is the width of field, which indicates that a real number should be printed with w positions. d indicates the number of digits after the decimal point. More precisely, of these w positions, the right-most d positions are for the fraction part of a real number, and the d+1 position from the right is a decimal point. The remaining w-(d+1) positions are for the integral part. This is shown in the figure below: When a real number is printed, its integral part is printed as if it uses Im-(d+1). Therefore, if the number of positions is not enough to print the integral part completely, all w positions will be filled with asterisks. Please note that the integral part contains a sign and as a result w should be greater than or equal to d+2. The fractional part may have more than d digits. In this case, the (d+1)th digit will be rounded to the dth one. For example, if 1.73 is printed with F3.1 (using 3 position to print a real number with the right-most 1 position for the fractional part), since the second digit of the fractional part is 3, the result is 1.7. However, if 1.76 is printed with F3.1, the result becomes 1.8 because 6 is rounded. The fractional part may have fewer than d digits. In this case, trailing zeros will be added. Note that d can be zero. In this case, no fractional part will be printed. More precisely, the right-most position is the decimal point. r is the repetition indicator, which gives the number of times the edit descriptor should be repeated. For example, 3F5.3 is equivalent to F5.3, F5.3, F5.3. Examples Let us look at the following example. There are two REAL variables a and b with values and , respectively. In the following table, the WRITE statements are shown at the left and their corresponding output, all using five positions, are shown at the right. 4/12

5 The first line prints with F10.0. This means that of the ten positions the rightmost one should contain a decimal point (since d is zero). Therefore, no fractional part is printed. The second line is easy. The third line uses F10.2 to print Of these ten positions, the last two are used to print the fractional part (i.e., 345). Therefore, the third digit, 5 is rounded yielding 35. Hence the result is The fourth line uses F10.4 to print Since there are four positions for the fractional part, which is larger than the number of actual digits, a trailing zero is added. The eighth line uses F10.7 to print Since there are only 10-(7+1)=2 positions for printing the integral part which has three digits, all 10 positions are filled with asterisks. The eleventh line has the same result. There are 10-(6+1)=3 positions for the integral part. However, the integral part -123 requires four positions. As a result, all 10 positions are filled with asterisks. Consider the following example. The WRITE statement has three REAL variables and consequently the format must also have three I edit descriptors, one for each variable. REAL :: a = 12.34, b = , c = WRITE(*,"(3F6.2)") a, b, c The edit descriptor is 3F6.2 and the format is equivalent to (F6.2,F6.2,F6.2) because the repetition indicator is 3. Therefore, each of these three REAL variables is printed with F6.2. Based on the discussion earlier, the result is the following: 5/12

6 REAL Output: The E Descriptor The Ew.d and Ew.dEe descriptors are for REAL output. The printed numbers will be in an exponential form. The general form of these descriptors are discussed below. There are two more forms, ESw.d and ENw.d, which will be discussed at the bottom of this page. The meaning of r, w, d and e are: rew.d and rew.dee E is for REAL numbers in exponential forms. w is the width of field, which indicates that a real number should be printed with w positions. To print a number in an exponential form, it is first converted to a normalized form s0.xxx...xxx*10 sxx, where s is the sign of the number and the exponent and x is a digit. For example, , , and are converted to *10 2, *10 2, 0.123*10-2 and *10-2. The Ew.d descriptor generates real numbers in the following form: Of these w positions, the last three are for the exponent, including its sign, the middle d positions are for the number in normalized form. Therefore, excluding the exponent part, there are w-4 positions for print the digits of the normalized number. In fact, you can consider the normalized number is printed with Fw-4.d. The above figure also includes a 0 and a decimal point. If the number is negative, we must also include its sign. Hence, 4+3=7 positions are not available for printing the normalized number and, as a result, when you use the E edit descriptor, w must be greater than or equal to d+7; otherwise, your number cannot be printed properly and all w positions will be filled with asterisks. The Ew.dEe descriptor generates real numbers in the following form: As you can see, the only difference is that the exponent part now has e positions. If your data has an exponent larger than 99 or less than -99, Ew.d will not be able to print it properly because there are only two positions for the exponent (therefore, all w positions will be filled with asterisks). As shown in the figure, in addition to the d positions for the normalized number and e positions for the exponent, we need four more positions for printing the sign in the exponent, a decimal point, a leading 0 and the character E. Moreover, if the number is negative, a sign before the 0 is needed. This means that w must be greater than or equal to d+e+5. r is the repetition indicator, which gives the number of times the edit descriptor should be repeated. For example, 3E20.7E2 is equivalent to E20.7E2, E20.7E2, E20.7E2. 6/12

7 Examples In the following table, the WRITE statements use different E edit descriptors to print the value of The WRITE statements are shown at the left and their corresponding output, all using 12 positions, are shown at the right. The first example uses E12.5 to print This number is first converted to *10 1. Therefore, the normalized number is and the exponent is 1. The exponent part is printed as E+01. Since we have only 5 positions for printing which has 8 digits, the sixth one will be rounded to the fifth and the result is The second example uses E12.3E4 to print the same number. This E descriptor indicates that four positions are for the exponent and, as a result, the printed exponent part is E The last example is obvious. However, if the number is changed to , the result will be 12 asterisks, since there is no position for the sign of the number. Editor Descriptor ESw.d and ESw.dEe Scientists write the exponential form in a slightly different way. This ES edit descriptor is for printing a real number in scientific form, which has a non-zero digit as the integral part. If the number is a zero, then all digits printed will be zero. The following shows the printed form: If you understand the form of normalized number, you can just shift the decimal point to the right one position and decrease the exponent by one. The result is in scientific form. For example, if the number is , it has a normalized form *10 2. Now shifting the decimal point to the right one position gives *10 1. The following shows the output printed with ES12.3E3: 7/12

8 Editor Descriptor ENw.d and ENw.dEe Engineers write the exponential form in yet another way. In an engineering form, the exponent is always a multiple of three, and the printed number always has no more than three and at least one non-zero digits. For example, suppose the given number is The integral part has four digits and the exponent is zero. To convert this number to an engineering form, the decimal point should be shifted to the left three positions. Thus, the given number has a new form *10 3. Similarly, if the given number is , shifting the decimal point to the right three positions gives *10-3. However, this is not yet in the engineering form, because the integral part is still zero. Therefore, we need to shift the decimal point to the right three positions again and this gives *10-6. Now, the number is in engineering form. The following shows the output of ENw.d and ENw.dEe. For ENw.d, it requires 4 positions for the exponent, d positions for the fractional part of the number, 3 positions for the integral part, one position for the decimal point, and one position for the possible sign. It requires at least d+9 positions and consequently for ENw.d, w must be larger than or equal to d+9. The same counting yields that for ENw.dEe, w must be larger than or equal to d+e+7. 8/12

9 LOGICAL Output: The L Descriptor The Lw descriptor is for LOGICAL output. While Fortran uses.true. and.false. to indicate logical values true and false, respectively, the output only show T and F. The general form of this descriptor is as follows: rlw The meaning of r and w are: L is for LOGICAL w is the width of field, which indicates that a logical value should be printed with w positions. The output of a LOGICAL value is either T for.true. or F for.false.. The single character value is shown in the right-most position and the remaining w-1 positions are filled with spaces. The is shown in the figure below. r is the repetition indicator, which gives the number of times the edit descriptor should be repeated. For example, 3I5.3 is equivalent to I5.3, I5.3, I5.3. Examples Let us look at the following example. There are two LOGICAL variables a and b with values.true. and.false., respectively. In the following table, the WRITE statements are shown at the left and their corresponding output are shown at the right. The first WRITE uses L1 and L2 to print.true. and.false., respectively. Therefore, a T is shown in position one (L1) and a F is shown in position three (L2). The second WRITE uses L3 and L4 to print.true. and.false.. Therefore, a T is printed in the third position of the first three positions, and a F is printed in the fourth position of the next four positions. There are seven positions used in total. 9/12

10 CHARACTER Output: The A Descriptor The A and Aw descriptors are for CHARACTER output. The general form of these descriptors are as follows: The meaning of r and w are: ra and raw A is for CHARACTER w is the width of field, which indicates that a character string should be printed with w positions. The output of the character string depends on two factors, namely the length of the character string and the value of w. Here are the rules: If w is larger than the length of the character string, all characters of the string can be printed and are right-justified. Also, leading spaces will be added. The following example prints the string "12345" of length 5 (i.e., five characters) using A6. WRITE(*,'(A6)') "12345" Since w is larger than the length of the string, all five characters are printed and right-justified. The result is shown below: If w is less than the length of the character string, then the string is truncated and only the left-most w positions are printed in the w positions. The following example prints the string " " of length 8 (i.e., eight characters) using A6. WRITE(*,'(A6)') " " Since w is less than the length of the string, only the first six characters are printed. The result is shown below: If w is equal to the length of the character string, then it is an exact match. All characters can be printed and all w positions are filled. If w is missing (i.e., edit descriptor A), then the value of w is assumed to be the length of the string. The following example shows two WRITE statements. The first one uses A to print a, a string of length 5. The second one also uses A to print b, a string of length 2. CHARACTER(LEN=5) :: a = "abcde" CHARACTER(LEN=2) :: b = "MI" WRITE(*,'(A)') a WRITE(*,'(A)') b 10/12

11 Since the A edit descriptor will use the length of the string as the value of w, the above is equivalent to the following: CHARACTER(LEN=5) :: a = "abcde" CHARACTER(LEN=2) :: b = "MI" WRITE(*,'(A5)') a WRITE(*,'(A2)') b Therefore, the A edit descriptor is more convenient than Aw. r is the repetition indicator, which gives the number of times the edit descriptor should be repeated. For example, 3A5 is equivalent to A5, A5, A5, and 3A is equivalent to A, A, A. Please keep in mind that the length of the string includes trailing spaces. For example, if we have the following: CHARACTER(LEN=5) :: a = "123" CHARACTER :: b = "*" WRITE(*,"(A,A)") a, b it is equivalent to CHARACTER(LEN=5) :: a = "123" CHARACTER :: b = "*" WRITE(*,"(A5,A1)") a, b and the result is The first string, a, is of length 5 and hence the first five positions are used. Why are two extra spaces when the string is written as a = "123"? Since the length of a is five and "123" has only three characters, two spaces are added to the right end to make up five characters. Therefore, variable a actually contains five characters: 1, 2, 3 and two spaces. This is why two spaces are between 123 and * in the above output. 11/12

12 Examples Let us look at the following example. CHARACTER(LEN=5) :: a = "12345" CHARACTER :: b = "*" In the following table, the WRITE statements are shown at the left and their corresponding output are shown at the right. In WRITE statements 1 to 5, since the first A edit descriptor is less than or equal to the length of the character variable, the strings to be printed are truncated from the right. In WRITE statements 6 and 7, since the first A edit descriptor is greater than the length of the character variable, leading spaces are added. Finally, in the eighth WRITE statement, since the first A has no width of field, it is assumed to be equal to the length of the variable. As a result, A5 is used and the result is identical to that of the fifth WRITE. 12/12

A Short Guide to Significant Figures

A Short Guide to Significant Figures A Short Guide to Significant Figures Quick Reference Section Here are the basic rules for significant figures - read the full text of this guide to gain a complete understanding of what these rules really

More information

COMP 250 Fall 2012 lecture 2 binary representations Sept. 11, 2012

COMP 250 Fall 2012 lecture 2 binary representations Sept. 11, 2012 Binary numbers The reason humans represent numbers using decimal (the ten digits from 0,1,... 9) is that we have ten fingers. There is no other reason than that. There is nothing special otherwise about

More information

.NET Standard DateTime Format Strings

.NET Standard DateTime Format Strings .NET Standard DateTime Format Strings Specifier Name Description d Short date pattern Represents a custom DateTime format string defined by the current ShortDatePattern property. D Long date pattern Represents

More information

2.2 Scientific Notation: Writing Large and Small Numbers

2.2 Scientific Notation: Writing Large and Small Numbers 2.2 Scientific Notation: Writing Large and Small Numbers A number written in scientific notation has two parts. A decimal part: a number that is between 1 and 10. An exponential part: 10 raised to an exponent,

More information

Rational Exponents. Squaring both sides of the equation yields. and to be consistent, we must have

Rational Exponents. Squaring both sides of the equation yields. and to be consistent, we must have 8.6 Rational Exponents 8.6 OBJECTIVES 1. Define rational exponents 2. Simplify expressions containing rational exponents 3. Use a calculator to estimate the value of an expression containing rational exponents

More information

Unit 1 Number Sense. In this unit, students will study repeating decimals, percents, fractions, decimals, and proportions.

Unit 1 Number Sense. In this unit, students will study repeating decimals, percents, fractions, decimals, and proportions. Unit 1 Number Sense In this unit, students will study repeating decimals, percents, fractions, decimals, and proportions. BLM Three Types of Percent Problems (p L-34) is a summary BLM for the material

More information

To convert an arbitrary power of 2 into its English equivalent, remember the rules of exponential arithmetic:

To convert an arbitrary power of 2 into its English equivalent, remember the rules of exponential arithmetic: Binary Numbers In computer science we deal almost exclusively with binary numbers. it will be very helpful to memorize some binary constants and their decimal and English equivalents. By English equivalents

More information

Computer Science 281 Binary and Hexadecimal Review

Computer Science 281 Binary and Hexadecimal Review Computer Science 281 Binary and Hexadecimal Review 1 The Binary Number System Computers store everything, both instructions and data, by using many, many transistors, each of which can be in one of two

More information

26 Integers: Multiplication, Division, and Order

26 Integers: Multiplication, Division, and Order 26 Integers: Multiplication, Division, and Order Integer multiplication and division are extensions of whole number multiplication and division. In multiplying and dividing integers, the one new issue

More information

Chapter 4: Computer Codes

Chapter 4: Computer Codes Slide 1/30 Learning Objectives In this chapter you will learn about: Computer data Computer codes: representation of data in binary Most commonly used computer codes Collating sequence 36 Slide 2/30 Data

More information

NUMBER SYSTEMS. William Stallings

NUMBER SYSTEMS. William Stallings NUMBER SYSTEMS William Stallings The Decimal System... The Binary System...3 Converting between Binary and Decimal...3 Integers...4 Fractions...5 Hexadecimal Notation...6 This document available at WilliamStallings.com/StudentSupport.html

More information

5.1 Radical Notation and Rational Exponents

5.1 Radical Notation and Rational Exponents Section 5.1 Radical Notation and Rational Exponents 1 5.1 Radical Notation and Rational Exponents We now review how exponents can be used to describe not only powers (such as 5 2 and 2 3 ), but also roots

More information

A.2. Exponents and Radicals. Integer Exponents. What you should learn. Exponential Notation. Why you should learn it. Properties of Exponents

A.2. Exponents and Radicals. Integer Exponents. What you should learn. Exponential Notation. Why you should learn it. Properties of Exponents Appendix A. Exponents and Radicals A11 A. Exponents and Radicals What you should learn Use properties of exponents. Use scientific notation to represent real numbers. Use properties of radicals. Simplify

More information

Part 1 Expressions, Equations, and Inequalities: Simplifying and Solving

Part 1 Expressions, Equations, and Inequalities: Simplifying and Solving Section 7 Algebraic Manipulations and Solving Part 1 Expressions, Equations, and Inequalities: Simplifying and Solving Before launching into the mathematics, let s take a moment to talk about the words

More information

The gas can has a capacity of 4.17 gallons and weighs 3.4 pounds.

The gas can has a capacity of 4.17 gallons and weighs 3.4 pounds. hundred million$ ten------ million$ million$ 00,000,000 0,000,000,000,000 00,000 0,000,000 00 0 0 0 0 0 0 0 0 0 Session 26 Decimal Fractions Explain the meaning of the values stated in the following sentence.

More information

Multiplying and Dividing Signed Numbers. Finding the Product of Two Signed Numbers. (a) (3)( 4) ( 4) ( 4) ( 4) 12 (b) (4)( 5) ( 5) ( 5) ( 5) ( 5) 20

Multiplying and Dividing Signed Numbers. Finding the Product of Two Signed Numbers. (a) (3)( 4) ( 4) ( 4) ( 4) 12 (b) (4)( 5) ( 5) ( 5) ( 5) ( 5) 20 SECTION.4 Multiplying and Dividing Signed Numbers.4 OBJECTIVES 1. Multiply signed numbers 2. Use the commutative property of multiplication 3. Use the associative property of multiplication 4. Divide signed

More information

Digital System Design Prof. D Roychoudhry Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Digital System Design Prof. D Roychoudhry Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Digital System Design Prof. D Roychoudhry Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture - 04 Digital Logic II May, I before starting the today s lecture

More information

Session 7 Fractions and Decimals

Session 7 Fractions and Decimals Key Terms in This Session Session 7 Fractions and Decimals Previously Introduced prime number rational numbers New in This Session period repeating decimal terminating decimal Introduction In this session,

More information

The string of digits 101101 in the binary number system represents the quantity

The string of digits 101101 in the binary number system represents the quantity Data Representation Section 3.1 Data Types Registers contain either data or control information Control information is a bit or group of bits used to specify the sequence of command signals needed for

More information

Binary Number System. 16. Binary Numbers. Base 10 digits: 0 1 2 3 4 5 6 7 8 9. Base 2 digits: 0 1

Binary Number System. 16. Binary Numbers. Base 10 digits: 0 1 2 3 4 5 6 7 8 9. Base 2 digits: 0 1 Binary Number System 1 Base 10 digits: 0 1 2 3 4 5 6 7 8 9 Base 2 digits: 0 1 Recall that in base 10, the digits of a number are just coefficients of powers of the base (10): 417 = 4 * 10 2 + 1 * 10 1

More information

Binary Adders: Half Adders and Full Adders

Binary Adders: Half Adders and Full Adders Binary Adders: Half Adders and Full Adders In this set of slides, we present the two basic types of adders: 1. Half adders, and 2. Full adders. Each type of adder functions to add two binary bits. In order

More information

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T)

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T) Unit- I Introduction to c Language: C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating

More information

How to Calculate the Probabilities of Winning the Eight LUCKY MONEY Prize Levels:

How to Calculate the Probabilities of Winning the Eight LUCKY MONEY Prize Levels: How to Calculate the Probabilities of Winning the Eight LUCKY MONEY Prize Levels: LUCKY MONEY numbers are drawn from two sets of numbers. Four numbers are drawn from one set of 47 numbered white balls

More information

Negative Integer Exponents

Negative Integer Exponents 7.7 Negative Integer Exponents 7.7 OBJECTIVES. Define the zero exponent 2. Use the definition of a negative exponent to simplify an expression 3. Use the properties of exponents to simplify expressions

More information

THE BINARY NUMBER SYSTEM

THE BINARY NUMBER SYSTEM THE BINARY NUMBER SYSTEM Dr. Robert P. Webber, Longwood University Our civilization uses the base 10 or decimal place value system. Each digit in a number represents a power of 10. For example, 365.42

More information

Useful Number Systems

Useful Number Systems Useful Number Systems Decimal Base = 10 Digit Set = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} Binary Base = 2 Digit Set = {0, 1} Octal Base = 8 = 2 3 Digit Set = {0, 1, 2, 3, 4, 5, 6, 7} Hexadecimal Base = 16 = 2

More information

Lecture 11: Number Systems

Lecture 11: Number Systems Lecture 11: Number Systems Numeric Data Fixed point Integers (12, 345, 20567 etc) Real fractions (23.45, 23., 0.145 etc.) Floating point such as 23. 45 e 12 Basically an exponent representation Any number

More information

Solution for Homework 2

Solution for Homework 2 Solution for Homework 2 Problem 1 a. What is the minimum number of bits that are required to uniquely represent the characters of English alphabet? (Consider upper case characters alone) The number of

More information

Section 4.1 Rules of Exponents

Section 4.1 Rules of Exponents Section 4.1 Rules of Exponents THE MEANING OF THE EXPONENT The exponent is an abbreviation for repeated multiplication. The repeated number is called a factor. x n means n factors of x. The exponent tells

More information

Base Conversion written by Cathy Saxton

Base Conversion written by Cathy Saxton Base Conversion written by Cathy Saxton 1. Base 10 In base 10, the digits, from right to left, specify the 1 s, 10 s, 100 s, 1000 s, etc. These are powers of 10 (10 x ): 10 0 = 1, 10 1 = 10, 10 2 = 100,

More information

Student Outcomes. Lesson Notes. Classwork. Discussion (10 minutes)

Student Outcomes. Lesson Notes. Classwork. Discussion (10 minutes) NYS COMMON CORE MATHEMATICS CURRICULUM Lesson 5 8 Student Outcomes Students know the definition of a number raised to a negative exponent. Students simplify and write equivalent expressions that contain

More information

6 3 4 9 = 6 10 + 3 10 + 4 10 + 9 10

6 3 4 9 = 6 10 + 3 10 + 4 10 + 9 10 Lesson The Binary Number System. Why Binary? The number system that you are familiar with, that you use every day, is the decimal number system, also commonly referred to as the base- system. When you

More information

Number Conversions Dr. Sarita Agarwal (Acharya Narendra Dev College,University of Delhi)

Number Conversions Dr. Sarita Agarwal (Acharya Narendra Dev College,University of Delhi) Conversions Dr. Sarita Agarwal (Acharya Narendra Dev College,University of Delhi) INTRODUCTION System- A number system defines a set of values to represent quantity. We talk about the number of people

More information

Section 1.5 Exponents, Square Roots, and the Order of Operations

Section 1.5 Exponents, Square Roots, and the Order of Operations Section 1.5 Exponents, Square Roots, and the Order of Operations Objectives In this section, you will learn to: To successfully complete this section, you need to understand: Identify perfect squares.

More information

1 Description of The Simpletron

1 Description of The Simpletron Simulating The Simpletron Computer 50 points 1 Description of The Simpletron In this assignment you will write a program to simulate a fictional computer that we will call the Simpletron. As its name implies

More information

Quick Reference ebook

Quick Reference ebook This file is distributed FREE OF CHARGE by the publisher Quick Reference Handbooks and the author. Quick Reference ebook Click on Contents or Index in the left panel to locate a topic. The math facts listed

More information

Negative Exponents and Scientific Notation

Negative Exponents and Scientific Notation 3.2 Negative Exponents and Scientific Notation 3.2 OBJECTIVES. Evaluate expressions involving zero or a negative exponent 2. Simplify expressions involving zero or a negative exponent 3. Write a decimal

More information

Data Storage. Chapter 3. Objectives. 3-1 Data Types. Data Inside the Computer. After studying this chapter, students should be able to:

Data Storage. Chapter 3. Objectives. 3-1 Data Types. Data Inside the Computer. After studying this chapter, students should be able to: Chapter 3 Data Storage Objectives After studying this chapter, students should be able to: List five different data types used in a computer. Describe how integers are stored in a computer. Describe how

More information

Section 1.4 Place Value Systems of Numeration in Other Bases

Section 1.4 Place Value Systems of Numeration in Other Bases Section.4 Place Value Systems of Numeration in Other Bases Other Bases The Hindu-Arabic system that is used in most of the world today is a positional value system with a base of ten. The simplest reason

More information

This 3-digit ASCII string could also be calculated as n = (Data[2]-0x30) +10*((Data[1]-0x30)+10*(Data[0]-0x30));

This 3-digit ASCII string could also be calculated as n = (Data[2]-0x30) +10*((Data[1]-0x30)+10*(Data[0]-0x30)); Introduction to Embedded Microcomputer Systems Lecture 5.1 2.9. Conversions ASCII to binary n = 100*(Data[0]-0x30) + 10*(Data[1]-0x30) + (Data[2]-0x30); This 3-digit ASCII string could also be calculated

More information

Fractions to decimals

Fractions to decimals Worksheet.4 Fractions and Decimals Section Fractions to decimals The most common method of converting fractions to decimals is to use a calculator. A fraction represents a division so is another way of

More information

23. RATIONAL EXPONENTS

23. RATIONAL EXPONENTS 23. RATIONAL EXPONENTS renaming radicals rational numbers writing radicals with rational exponents When serious work needs to be done with radicals, they are usually changed to a name that uses exponents,

More information

A Programming Language for Mechanical Translation Victor H. Yngve, Massachusetts Institute of Technology, Cambridge, Massachusetts

A Programming Language for Mechanical Translation Victor H. Yngve, Massachusetts Institute of Technology, Cambridge, Massachusetts [Mechanical Translation, vol.5, no.1, July 1958; pp. 25-41] A Programming Language for Mechanical Translation Victor H. Yngve, Massachusetts Institute of Technology, Cambridge, Massachusetts A notational

More information

1. Give the 16 bit signed (twos complement) representation of the following decimal numbers, and convert to hexadecimal:

1. Give the 16 bit signed (twos complement) representation of the following decimal numbers, and convert to hexadecimal: Exercises 1 - number representations Questions 1. Give the 16 bit signed (twos complement) representation of the following decimal numbers, and convert to hexadecimal: (a) 3012 (b) - 435 2. For each of

More information

Properties of Real Numbers

Properties of Real Numbers 16 Chapter P Prerequisites P.2 Properties of Real Numbers What you should learn: Identify and use the basic properties of real numbers Develop and use additional properties of real numbers Why you should

More information

Recall the process used for adding decimal numbers. 1. Place the numbers to be added in vertical format, aligning the decimal points.

Recall the process used for adding decimal numbers. 1. Place the numbers to be added in vertical format, aligning the decimal points. 2 MODULE 4. DECIMALS 4a Decimal Arithmetic Adding Decimals Recall the process used for adding decimal numbers. Adding Decimals. To add decimal numbers, proceed as follows: 1. Place the numbers to be added

More information

MULTIPLICATION AND DIVISION OF REAL NUMBERS In this section we will complete the study of the four basic operations with real numbers.

MULTIPLICATION AND DIVISION OF REAL NUMBERS In this section we will complete the study of the four basic operations with real numbers. 1.4 Multiplication and (1-25) 25 In this section Multiplication of Real Numbers Division by Zero helpful hint The product of two numbers with like signs is positive, but the product of three numbers with

More information

Data Storage 3.1. Foundations of Computer Science Cengage Learning

Data Storage 3.1. Foundations of Computer Science Cengage Learning 3 Data Storage 3.1 Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: List five different data types used in a computer. Describe how

More information

Teaching Pre-Algebra in PowerPoint

Teaching Pre-Algebra in PowerPoint Key Vocabulary: Numerator, Denominator, Ratio Title Key Skills: Convert Fractions to Decimals Long Division Convert Decimals to Percents Rounding Percents Slide #1: Start the lesson in Presentation Mode

More information

This Unit: Floating Point Arithmetic. CIS 371 Computer Organization and Design. Readings. Floating Point (FP) Numbers

This Unit: Floating Point Arithmetic. CIS 371 Computer Organization and Design. Readings. Floating Point (FP) Numbers This Unit: Floating Point Arithmetic CIS 371 Computer Organization and Design Unit 7: Floating Point App App App System software Mem CPU I/O Formats Precision and range IEEE 754 standard Operations Addition

More information

Chapter 7: Additional Topics

Chapter 7: Additional Topics Chapter 7: Additional Topics In this chapter we ll briefly cover selected advanced topics in fortran programming. All the topics come in handy to add extra functionality to programs, but the feature you

More information

Lecture 2. Binary and Hexadecimal Numbers

Lecture 2. Binary and Hexadecimal Numbers Lecture 2 Binary and Hexadecimal Numbers Purpose: Review binary and hexadecimal number representations Convert directly from one base to another base Review addition and subtraction in binary representations

More information

Figure 1. A typical Laboratory Thermometer graduated in C.

Figure 1. A typical Laboratory Thermometer graduated in C. SIGNIFICANT FIGURES, EXPONENTS, AND SCIENTIFIC NOTATION 2004, 1990 by David A. Katz. All rights reserved. Permission for classroom use as long as the original copyright is included. 1. SIGNIFICANT FIGURES

More information

MATH-0910 Review Concepts (Haugen)

MATH-0910 Review Concepts (Haugen) Unit 1 Whole Numbers and Fractions MATH-0910 Review Concepts (Haugen) Exam 1 Sections 1.5, 1.6, 1.7, 1.8, 2.1, 2.2, 2.3, 2.4, and 2.5 Dividing Whole Numbers Equivalent ways of expressing division: a b,

More information

Binary Division. Decimal Division. Hardware for Binary Division. Simple 16-bit Divider Circuit

Binary Division. Decimal Division. Hardware for Binary Division. Simple 16-bit Divider Circuit Decimal Division Remember 4th grade long division? 43 // quotient 12 521 // divisor dividend -480 41-36 5 // remainder Shift divisor left (multiply by 10) until MSB lines up with dividend s Repeat until

More information

Formatting Numbers with C++ Output Streams

Formatting Numbers with C++ Output Streams Formatting Numbers with C++ Output Streams David Kieras, EECS Dept., Univ. of Michigan Revised for EECS 381, Winter 2004. Using the output operator with C++ streams is generally easy as pie, with the only

More information

This is a square root. The number under the radical is 9. (An asterisk * means multiply.)

This is a square root. The number under the radical is 9. (An asterisk * means multiply.) Page of Review of Radical Expressions and Equations Skills involving radicals can be divided into the following groups: Evaluate square roots or higher order roots. Simplify radical expressions. Rationalize

More information

Notes on Complexity Theory Last updated: August, 2011. Lecture 1

Notes on Complexity Theory Last updated: August, 2011. Lecture 1 Notes on Complexity Theory Last updated: August, 2011 Jonathan Katz Lecture 1 1 Turing Machines I assume that most students have encountered Turing machines before. (Students who have not may want to look

More information

Binary, Hexadecimal, Octal, and BCD Numbers

Binary, Hexadecimal, Octal, and BCD Numbers 23CH_PHCalter_TMSETE_949118 23/2/2007 1:37 PM Page 1 Binary, Hexadecimal, Octal, and BCD Numbers OBJECTIVES When you have completed this chapter, you should be able to: Convert between binary and decimal

More information

The Mathematics 11 Competency Test Percent Increase or Decrease

The Mathematics 11 Competency Test Percent Increase or Decrease The Mathematics 11 Competency Test Percent Increase or Decrease The language of percent is frequently used to indicate the relative degree to which some quantity changes. So, we often speak of percent

More information

47 Numerator Denominator

47 Numerator Denominator JH WEEKLIES ISSUE #22 2012-2013 Mathematics Fractions Mathematicians often have to deal with numbers that are not whole numbers (1, 2, 3 etc.). The preferred way to represent these partial numbers (rational

More information

Training Manual. Pre-Employment Math. Version 1.1

Training Manual. Pre-Employment Math. Version 1.1 Training Manual Pre-Employment Math Version 1.1 Created April 2012 1 Table of Contents Item # Training Topic Page # 1. Operations with Whole Numbers... 3 2. Operations with Decimal Numbers... 4 3. Operations

More information

Row Echelon Form and Reduced Row Echelon Form

Row Echelon Form and Reduced Row Echelon Form These notes closely follow the presentation of the material given in David C Lay s textbook Linear Algebra and its Applications (3rd edition) These notes are intended primarily for in-class presentation

More information

2015 County Auditors Institute. May 2015. Excel Workshop Tips. Working Smarter, Not Harder. by David Scott, SpeakGeek@att.net

2015 County Auditors Institute. May 2015. Excel Workshop Tips. Working Smarter, Not Harder. by David Scott, SpeakGeek@att.net 2015 County Auditors Institute May 2015 Excel Workshop Tips Working Smarter, Not Harder by David Scott, SpeakGeek@att.net Note: All examples in this workshop and this tip sheet were done using Excel 2010

More information

CHAPTER 5 Round-off errors

CHAPTER 5 Round-off errors CHAPTER 5 Round-off errors In the two previous chapters we have seen how numbers can be represented in the binary numeral system and how this is the basis for representing numbers in computers. Since any

More information

plc numbers - 13.1 Encoded values; BCD and ASCII Error detection; parity, gray code and checksums

plc numbers - 13.1 Encoded values; BCD and ASCII Error detection; parity, gray code and checksums plc numbers - 3. Topics: Number bases; binary, octal, decimal, hexadecimal Binary calculations; s compliments, addition, subtraction and Boolean operations Encoded values; BCD and ASCII Error detection;

More information

Review of Scientific Notation and Significant Figures

Review of Scientific Notation and Significant Figures II-1 Scientific Notation Review of Scientific Notation and Significant Figures Frequently numbers that occur in physics and other sciences are either very large or very small. For example, the speed of

More information

SYSTEMS OF EQUATIONS AND MATRICES WITH THE TI-89. by Joseph Collison

SYSTEMS OF EQUATIONS AND MATRICES WITH THE TI-89. by Joseph Collison SYSTEMS OF EQUATIONS AND MATRICES WITH THE TI-89 by Joseph Collison Copyright 2000 by Joseph Collison All rights reserved Reproduction or translation of any part of this work beyond that permitted by Sections

More information

Systems I: Computer Organization and Architecture

Systems I: Computer Organization and Architecture Systems I: Computer Organization and Architecture Lecture 2: Number Systems and Arithmetic Number Systems - Base The number system that we use is base : 734 = + 7 + 3 + 4 = x + 7x + 3x + 4x = x 3 + 7x

More information

Fraction Tools. Martin Kindt & Truus Dekker. ------------ 3n 4 -----

Fraction Tools. Martin Kindt & Truus Dekker. ------------ 3n 4 ----- Fraction Tools - + - 0 - n + n Martin Kindt & Truus Dekker 0 Section A Comparing Fractions - Parts and pieces (). Of each figure, color part. Be as precise as possible.. Of each figure, color part. Each

More information

Solutions of Linear Equations in One Variable

Solutions of Linear Equations in One Variable 2. Solutions of Linear Equations in One Variable 2. OBJECTIVES. Identify a linear equation 2. Combine like terms to solve an equation We begin this chapter by considering one of the most important tools

More information

MATLAB Programming. Problem 1: Sequential

MATLAB Programming. Problem 1: Sequential Division of Engineering Fundamentals, Copyright 1999 by J.C. Malzahn Kampe 1 / 21 MATLAB Programming When we use the phrase computer solution, it should be understood that a computer will only follow directions;

More information

PREPARATION FOR MATH TESTING at CityLab Academy

PREPARATION FOR MATH TESTING at CityLab Academy PREPARATION FOR MATH TESTING at CityLab Academy compiled by Gloria Vachino, M.S. Refresh your math skills with a MATH REVIEW and find out if you are ready for the math entrance test by taking a PRE-TEST

More information

CHAPTER 4 DIMENSIONAL ANALYSIS

CHAPTER 4 DIMENSIONAL ANALYSIS CHAPTER 4 DIMENSIONAL ANALYSIS 1. DIMENSIONAL ANALYSIS Dimensional analysis, which is also known as the factor label method or unit conversion method, is an extremely important tool in the field of chemistry.

More information

2010/9/19. Binary number system. Binary numbers. Outline. Binary to decimal

2010/9/19. Binary number system. Binary numbers. Outline. Binary to decimal 2/9/9 Binary number system Computer (electronic) systems prefer binary numbers Binary number: represent a number in base-2 Binary numbers 2 3 + 7 + 5 Some terminology Bit: a binary digit ( or ) Hexadecimal

More information

IB Math Research Problem

IB Math Research Problem Vincent Chu Block F IB Math Research Problem The product of all factors of 2000 can be found using several methods. One of the methods I employed in the beginning is a primitive one I wrote a computer

More information

Welcome to Basic Math Skills!

Welcome to Basic Math Skills! Basic Math Skills Welcome to Basic Math Skills! Most students find the math sections to be the most difficult. Basic Math Skills was designed to give you a refresher on the basics of math. There are lots

More information

JobTestPrep's Numeracy Review Decimals & Percentages

JobTestPrep's Numeracy Review Decimals & Percentages JobTestPrep's Numeracy Review Decimals & Percentages 1 Table of contents What is decimal? 3 Converting fractions to decimals 4 Converting decimals to fractions 6 Percentages 6 Adding and subtracting decimals

More information

Ready, Set, Go! Math Games for Serious Minds

Ready, Set, Go! Math Games for Serious Minds Math Games with Cards and Dice presented at NAGC November, 2013 Ready, Set, Go! Math Games for Serious Minds Rande McCreight Lincoln Public Schools Lincoln, Nebraska Math Games with Cards Close to 20 -

More information

Binary Representation. Number Systems. Base 10, Base 2, Base 16. Positional Notation. Conversion of Any Base to Decimal.

Binary Representation. Number Systems. Base 10, Base 2, Base 16. Positional Notation. Conversion of Any Base to Decimal. Binary Representation The basis of all digital data is binary representation. Binary - means two 1, 0 True, False Hot, Cold On, Off We must be able to handle more than just values for real world problems

More information

VALUE 11.125%. $100,000 2003 (=MATURITY

VALUE 11.125%. $100,000 2003 (=MATURITY NOTES H IX. How to Read Financial Bond Pages Understanding of the previously discussed interest rate measures will permit you to make sense out of the tables found in the financial sections of newspapers

More information

Automata and Computability. Solutions to Exercises

Automata and Computability. Solutions to Exercises Automata and Computability Solutions to Exercises Fall 25 Alexis Maciel Department of Computer Science Clarkson University Copyright c 25 Alexis Maciel ii Contents Preface vii Introduction 2 Finite Automata

More information

LESSON PLANS FOR PERCENTAGES, FRACTIONS, DECIMALS, AND ORDERING Lesson Purpose: The students will be able to:

LESSON PLANS FOR PERCENTAGES, FRACTIONS, DECIMALS, AND ORDERING Lesson Purpose: The students will be able to: LESSON PLANS FOR PERCENTAGES, FRACTIONS, DECIMALS, AND ORDERING Lesson Purpose: The students will be able to: 1. Change fractions to decimals. 2. Change decimals to fractions. 3. Change percents to decimals.

More information

pi: 3.14159265... in the examples below.

pi: 3.14159265... in the examples below. Rounding Numbers When you have to round a number, you are usually told how to round it. It's simplest when you're told how many "places" to round to, but you should also know how to round to a named "place",

More information

Mathematical Induction

Mathematical Induction Mathematical Induction In logic, we often want to prove that every member of an infinite set has some feature. E.g., we would like to show: N 1 : is a number 1 : has the feature Φ ( x)(n 1 x! 1 x) How

More information

Exponents. Learning Objectives 4-1

Exponents. Learning Objectives 4-1 Eponents -1 to - Learning Objectives -1 The product rule for eponents The quotient rule for eponents The power rule for eponents Power rules for products and quotient We can simplify by combining the like

More information

Integer Operations. Overview. Grade 7 Mathematics, Quarter 1, Unit 1.1. Number of Instructional Days: 15 (1 day = 45 minutes) Essential Questions

Integer Operations. Overview. Grade 7 Mathematics, Quarter 1, Unit 1.1. Number of Instructional Days: 15 (1 day = 45 minutes) Essential Questions Grade 7 Mathematics, Quarter 1, Unit 1.1 Integer Operations Overview Number of Instructional Days: 15 (1 day = 45 minutes) Content to Be Learned Describe situations in which opposites combine to make zero.

More information

Math Workshop October 2010 Fractions and Repeating Decimals

Math Workshop October 2010 Fractions and Repeating Decimals Math Workshop October 2010 Fractions and Repeating Decimals This evening we will investigate the patterns that arise when converting fractions to decimals. As an example of what we will be looking at,

More information

HOMEWORK # 2 SOLUTIO

HOMEWORK # 2 SOLUTIO HOMEWORK # 2 SOLUTIO Problem 1 (2 points) a. There are 313 characters in the Tamil language. If every character is to be encoded into a unique bit pattern, what is the minimum number of bits required to

More information

Secrets of printf. 1 Background. 2 Simple Printing. Professor Don Colton. Brigham Young University Hawaii. 2.1 Naturally Special Characters

Secrets of printf. 1 Background. 2 Simple Printing. Professor Don Colton. Brigham Young University Hawaii. 2.1 Naturally Special Characters Secrets of Professor Don Colton Brigham Young University Hawaii is the C language function to do formatted printing. The same function is also available in PERL. This paper explains how works, and how

More information

5.1 Introduction to Decimals, Place Value, and Rounding

5.1 Introduction to Decimals, Place Value, and Rounding 5.1 Introduction to Decimals, Place Value, and Rounding 5.1 OBJECTIVES 1. Identify place value in a decimal fraction 2. Write a decimal in words 3. Write a decimal as a fraction or mixed number 4. Compare

More information

Numeral Systems. The number twenty-five can be represented in many ways: Decimal system (base 10): 25 Roman numerals:

Numeral Systems. The number twenty-five can be represented in many ways: Decimal system (base 10): 25 Roman numerals: Numeral Systems Which number is larger? 25 8 We need to distinguish between numbers and the symbols that represent them, called numerals. The number 25 is larger than 8, but the numeral 8 above is larger

More information

Rational Number Project

Rational Number Project Rational Number Project Fraction Operations and Initial Decimal Ideas Lesson : Overview Students estimate sums and differences using mental images of the 0 x 0 grid. Students develop strategies for adding

More information

Basic numerical skills: FRACTIONS, DECIMALS, PROPORTIONS, RATIOS AND PERCENTAGES

Basic numerical skills: FRACTIONS, DECIMALS, PROPORTIONS, RATIOS AND PERCENTAGES Basic numerical skills: FRACTIONS, DECIMALS, PROPORTIONS, RATIOS AND PERCENTAGES. Introduction (simple) This helpsheet is concerned with the ways that we express quantities that are not whole numbers,

More information

Guidance paper - The use of calculators in the teaching and learning of mathematics

Guidance paper - The use of calculators in the teaching and learning of mathematics Guidance paper - The use of calculators in the teaching and learning of mathematics Background and context In mathematics, the calculator can be an effective teaching and learning resource in the primary

More information

All the examples in this worksheet and all the answers to questions are available as answer sheets or videos.

All the examples in this worksheet and all the answers to questions are available as answer sheets or videos. BIRKBECK MATHS SUPPORT www.mathsupport.wordpress.com Numbers 3 In this section we will look at - improper fractions and mixed fractions - multiplying and dividing fractions - what decimals mean and exponents

More information

Review of Fundamental Mathematics

Review of Fundamental Mathematics Review of Fundamental Mathematics As explained in the Preface and in Chapter 1 of your textbook, managerial economics applies microeconomic theory to business decision making. The decision-making tools

More information

Object-Oriented Design Lecture 4 CSU 370 Fall 2007 (Pucella) Tuesday, Sep 18, 2007

Object-Oriented Design Lecture 4 CSU 370 Fall 2007 (Pucella) Tuesday, Sep 18, 2007 Object-Oriented Design Lecture 4 CSU 370 Fall 2007 (Pucella) Tuesday, Sep 18, 2007 The Java Type System By now, you have seen a fair amount of Java. Time to study in more depth the foundations of the language,

More information

Commonly Used Excel Formulas

Commonly Used Excel Formulas Microsoft Excel 2007 Advanced Formulas Windows XP Look Up Values in a List of Data: Commonly Used Excel Formulas Let's say you want to look up an employee's phone extension by using their badge number

More information

Pre-Algebra Lecture 6

Pre-Algebra Lecture 6 Pre-Algebra Lecture 6 Today we will discuss Decimals and Percentages. Outline: 1. Decimals 2. Ordering Decimals 3. Rounding Decimals 4. Adding and subtracting Decimals 5. Multiplying and Dividing Decimals

More information