Functional Problem Solving (CSC 151 2013F) : Reference
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] [FAQ] [IRC] [Teaching & Learning] [Grading]
Current: [Assignment] [EBoard] [Lab] [Outline] [Partners] [Reading]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Partners] [Readings]
Reference: [Setup] - [Functions A-Z] [Functions By Topic] - [Racket] [Scheme Report (R5RS)] [R6RS] [TSPL4]
Related Courses: [Davis (2013F)] [Rebelsky (2010F)] [Weinman (2012F)]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] [Issue Tracker (Course)]
(number?
val)
val is a number.
(integer?
val)
val is an integer.
(rational?
val)
val can be interpreted
as a rational number.
(real?
val)
val is a real number.
(complex?
val)
val can be interpreted
as a complex number.
(max
v1
v2)
v1 and
v2.
(max
v1
v2
...
vn)
v1
through vn.
(min
v1
v2)
v1 and
v2.
(min
v1
v2
...
vn)
v1
through vn.
(quotient
dividend
divisor)
dividend and
divisor, both of which must be integers.
The quotient is the whole part of the result of dividing
dividend by divisor.
(remainder
dividend
divisor)
dividend by divisor.
(modulo
value
modulus)
modulus-sized sections, gives the
offset of value from the start of its
section.
(floor
num)
num. That is, round down.
(ceiling
num)
num. That is, round up.
(truncate
num)
num.
That is, round toward zero.
(round
num)
num toward the nearest integer.
If the decimal portion of num is greater
than 1/2, rounds up. If the decimal portion is less than
1/2, rounds down. If the decimal portion equals 1/2, may
round in either direction. (In most implementations,
numbers with fractional portions equal to 1/2 round toward
the even number.)
(exact?
num)
num is
represented exactly (that is, not approximated).
(inexact?
num)
num is
represented inexactly (that is, approximated).
(even?
int)
int is
even (that is, has a remainder of 0 when divided by 2).
(odd?
int)
int is
odd (that is, has a remainder of 1 when divided by 2).
(zero?
num)
num is
zero.
(positive?
num)
num is
positive (greater than zero).
(negative?
num)
num is
negative (less than zero).
(exact->inexact
num)
num.
(inexact->exact
num)
num.
(Of course, if num was already
approximated, the result, while exact, still approximates
whatever num approximated.)
(abs
num)
num.
(expt
base
power)
basepower.
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] [FAQ] [IRC] [Teaching & Learning] [Grading]
Current: [Assignment] [EBoard] [Lab] [Outline] [Partners] [Reading]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Partners] [Readings]
Reference: [Setup] - [Functions A-Z] [Functions By Topic] - [Racket] [Scheme Report (R5RS)] [R6RS] [TSPL4]
Related Courses: [Davis (2013F)] [Rebelsky (2010F)] [Weinman (2012F)]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] [Issue Tracker (Course)]
Samuel A. Rebelsky, rebelsky@grinnell.edu
Copyright (c) 2007-2013 Janet Davis, Samuel A. Rebelsky, and Jerod Weinman. (Selected materials are copyright by John David Stone or Henry Walker and are used with permission.)

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.