Functional Problem Solving (CSC 151 2014S) : EBoards

CSC151.02 2014S, Class 04: Computing with Symbols and Numbers


Overview

Preliminaries

Admin

Upcoming Work

Questions

Quiz

Lab

Why do we get really weird numerators and denominators for simple things like 0.1?

Scheme represents every decimal number as a sum of values of the form 1/2^k * So, 1/10 = 1/16 + 1/32 + 1/256 + .... * When we simplify, we get some silly numerator and denominator.
* In this case something like 25/256. * As we get more accurate in our estimate, the larger the numerator and denominator get.

_Help me think about modulo.

Answer 1: It's like remainder, except for negative numbers. For negative numbers add modulus

(remainder -7 8) -> -7 (mod -7 8) -> 1

Answer 2: See today's outline, there's a pretty picture.


Samuel A. Rebelsky, rebelsky@grinnell.edu

Copyright (c) 2007-2014 Janet Davis, Samuel A. Rebelsky, and Jerod Weinman. (Selected materials are copyright by John David Stone or Henry Walker and are used with permission.)

Creative Commons License

This work is licensed under a Creative Commons Attribution 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/3.0/ or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.