Functional Problem Solving (CSC 151 2016S) : EBoards
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)]
Overview
If you know of other events, please suggest them! (I might not always agree, but it never hurts to ask.)
What does round do?
Makes things the same shape as Sam. NO!
Rounds to the closest number.
Above 0.5 rounds to higher number
Below 0.5 rounds to lower number
At 0.5 rounds to the lower number
(round 2.6) => 3 (round 2.4) => 2 (round -2.6) => -3 (round -2.4) => -2 (round 2.5) => 2 or 3
Whoops! What about inexact numbers
(round 5/2) => 2 or 3 (correct answer: 2) (round 7/2) => 3 or 4 (correct answer: 4) (round -5/2) => -2 (round -7/2) => -4
The magic Google says ... "It rounds to even when it is x and a half."
Good Grinnell students ask why?
Writeup: Exercise 5
Reminder: It's a good idea to do (or at least read through) all of the problems.