Functional Problem Solving (CSC 151 2015F) : Outlines
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] - [FAQ] [Teaching & Learning] [Grading] [Taking Notes] [Rubric] [Remote Access]
Current: [Assignment] [EBoard] [Lab] [Outline] [Reading]
Sections: [Assignments] [EBoards] [Labs] [Outlines] [Readings] - [Examples] [Handouts]
Reference: [Setup] [VM] [Errors] - [Functions A-Z] [Functions By Topic] - [Racket] [Scheme Report (R5RS)] [R6RS] [TSPL4]
Related Courses: [Curtsinger (2015F)] [Davis (2013F)] [Rebelsky (2015S)] [Weinman (2014F)]
Misc: [Submit Questions] - [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] - [Issue Tracker (Course)]
Held: Wednesday, 2 September 2015
Back to Outline 03 - An Introduction to Scheme. On to Outline 05 - RGB Colors.
Summary
We explore a bit more about data in Scheme, particularly the ways in which our version of Scheme supports numbers.
Related Pages
Overview
Administrivia
How do you know if the square root procedure behaved properly?
What were some things you discovered about Scheme?
+) on numbers and we
can use the string-append operation on strings.number?,
real?,
integer?,
exact?, and
inexact?.mod (modulo, modulus) operation is one of the trickier
operations we use in this class (and we use it a lot).mod is like remainder except that it always gives positive
values, even when the dividend is negative.
(mod dividend divisor) is
(+ divisor (quotient dividend divisor)).mod is used to break up the number line into
even chunks.
Number line: -9 -8|-7 -6 -5 -4 -3 -2 -1| 0 1 2 3 4 5 6| 7 8 9 10 11 Modulo 7: 5 6| 0 1 2 3 4 5 6| 0 1 2 3 4 5 6| 0 1 2 3 4
(modulo *i* *n*) operation allows us to
cycle through the numbers between 0 and *n*-1.