Slashdot Mirror


The Trouble With Rounding Floats

lukfil writes "We all know of floating point numbers, so much so that we reach for them each time we write code that does math. But do we ever stop to think what goes on inside that floating point unit and whether we can really trust it?"

2 of 456 comments (clear)

  1. Obligatory by karvind · · Score: 0, Offtopic

    Office Space

  2. Re:It used to be much worse. Kahan fixed it. by mbakunin · · Score: 0, Offtopic

    This takes me back.

    I took honors Soph Math at Cal from Bill Kahan in 1988 as a freshman. Despite never changing clothes (I mean, they were always clean, but he always wore blue jeans and a blue shirt -- all semester long), BK was a very engaging lecturer, which the interview should convey. He was also something of a rat bastard as a teacher. If you didn't get it, you were to reapproach the textbook. I went to office hours. He was friendly, but not helpful.

    He failed half the class.

    Half.

    The.

    Class.

    And these were kids at Cal (selection bias part one) taking a serious math class (two) and having chosen the honors course (three). Among other reasons, the utter lack of this sort of experience explains why I consider Ivy League schools lightweight for undergrads.

    He gave us a four-year-old midterm. It happened to have been given in the doctoral version of the course. It was a well-written exam, I grant. I was nineteen, taking a midterm that had been designed for UC Berkeley math doctoral candidates. Sure, no problem.

    He made both TAs take the final.

    One of two TAs (not mine, she was great) failed it.

    Let's just say that was the proudest B of my life.

    To Kahan's credit, he convinced me to pony up for the HP 11C calculator and never, ever to take a Cal honors class again. I have a math degree, can you believe it?