CSC151.01 2006S, Class 06: Numeric Values Admin: * Absent: LaRue * Tomorrow we meet in 2435 * Two readings for tomorrow: Characters and Strings * HW2 returned. Things are looking up on grading. Perhaps you'll get most of your assignments graded. * Groups for the week assigned. * An and Cloninger * Berg and Mertes * Bonnin Cadogan and LaRue * Brooks and Pan * Brown and Harrington * Cartegena and Potthoff * Howard and Rider * McArdle and McFarlin * Rich and Zamora * McDonald and Miller * Thompson and Wood * Strategy for assigning groups * Same sex (We'll do mixed groups next week). * Attempt to group first-years and upper-level students. * Other strategies in other weeks (often "random") * Extra credit: * Con Brio concert was a myth. * Limit to two of any one category (Con Brio concerts, Football games, etc.) * Tomorrow: Department Extra (12:45-2:00 p.m. in Science 2424) * Thursday: Convo (11:00-noon, Herrick) * Reminder: I expect you to try to do the reading in advance of each class. * Apologies: Today is definitely a "lab techniques" day. Overview: * Types. * Review of Reading * Lab. * Reflection. Types of Numbers: * Categorization: Precise and Imprecise * Precise: Represented exactly * Imprecise: Approximated * Approximation may * Save memory * Some numbers cannot be represented exactly (e.g., pi) * The user requests it. * Might be easier to work with * More accurately represents situation * Permit decimal representation * Different types of number: * Integers * "whole numbers" * Numbers with no fractional component * Rational * Ratio of integers * Real * Traditionally a bigger category, includes both rational and irrational numbers * In Scheme, every real is rational * Complex * Include imaginary parts (the square root of -1) * Can be thought of as points on a plane Aligning Windows * Some find it useful to resize to have lab and DrScheme side-by-side Strategies for Answering Questions * 1. Type the expressions in the bottom window and look at results. > (real? 3/4) #t > (rational? 3/4) #t * 2. Type the expressions in the top window, click "Run", and look at results. (real? 3/4) (rational? 3/4) RUN #t #t * 3. Name the expressions in the top window, click "Run", and query results (define ex1a (real? 3/4)) (define ex1b (rational? 3/4)) RUN > ex1a #t > ex1b #t * Intersperse symbols that indicate what you're computing 'is-three-forths-real? (real? 3/4) 'is-three-forths-rational? (rational? 3/4) RUN is-three-forths-real? #t is-three-forths-rational? #t Exploring procedures should normally involve more than one check. * Positive and negative * Integer, rational, and complex * Exact and inexact * ...