lecture04-jan28 - 1/28/09 EE312 - Lecture 4 Announcements...

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

View Full Document Right Arrow Icon
1/28/09 1 EE312 - Lecture 4 Announcements • Assignment 1 – Due Friday • Read Chapters 5 and 6 for next week • Topics for today will address: – Floating point numbers finished – formatted input and output (Ch. 3) Floating Point • Capable of representing fractional numbers • Numbers are stored in 3 parts: – Sign bit ( + / -) – Exponent (10 n , number of bits size) – Fraction (number of bits precision) • Three floating point formats are: float single precision double double precision long double extended precision • Nearly all engineering calculations should use double or long double Floating Point Literals 57.0 57. 57.0e0 5.7e+1 .57e2 570.e-1 Must contain decimal point and optionally an exponent By default stored as double-precision numbers F or f, L or l can be used to force storage format Type Smallest Value (+) Largest Value (+) Precision foat (32) 1.17x10 -38 3.40x10 38 Up to 6 digits double (64) 2.22x10 -308 1.79x10 308 Up to 15 digits IEEE Standard 754 Floating Point Characteristics long double is not deFned by this standard and is usually 80 or 128 bits C Math Library Functions • See Ch. 23.3 and appendix D #include <math.h> – Trig functions – Hyperbolic functions – Exponential functions – Logarithmic functions – Power functions – Nearest integer – Absolute value – Remainder functions ±unctions are called by name ( values-passed ), e.g. double x; x = sqrt (3.0); /* x will be 1.73205 */
Background image of page 1

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

View Full DocumentRight Arrow Icon
1/28/09 2 Formatted Input and Output • For simplifying the process of inputting values into and out of your program while its running. • The stdio library contains a function for reading values from the keyboard (the standard input device) and a function for writing out values to the screen (the standard output device) according to a given format specification . • The functions are named:
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

lecture04-jan28 - 1/28/09 EE312 - Lecture 4 Announcements...

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

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