Functional Problem Solving (CSC 151 2016S) : Outlines
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] - [FAQ] [Teaching & Learning] [Grading] [Taking Notes] [Rubric]
Current: [Assignment] [EBoard] [Lab] [Outline] [Reading]
Sections: [Assignments] [EBoards] [Labs] [Outlines] [Readings] - [Examples] [Handouts]
Reference: [Setup] [Remote] [VM] [Errors] - [Functions A-Z] [Functions By Topic] - [Racket] [Scheme Report (R5RS)] [R6RS] [TSPL4]
Related Courses: [Curtsinger (2016S)] [Davis (2013F)] [Rebelsky (2015F)] [Weinman (2014F)]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] - [Issue Tracker (Course)]
Held: Friday, 29 January 2016
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
+) 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.