logoalt Hacker News

emil-lpyesterday at 1:09 PM5 repliesview on HN

Are you saying that my students should memorize which numbers are actual floats and which are not?

    > 1.25 * 0.1
    
    0.1250000000000000069388939039

Replies

SideQuarkyesterday at 8:04 PM

If they were taught what was representable and why they’d learn it quickly. And those that forget details later know to chase it down again if they need it. Making it voodoo hides that it’s learnable, deterministic, and useful to understand.

stephencanonyesterday at 3:49 PM

Your students should be able to figure out if a computation is exact or not, because they should understand binary representation of numbers.

dehrmannyesterday at 3:50 PM

Tell them that they can only store integer powers of 2 and their sums exactly. 2^0 == 1. 2^-2 == .25. Then say it's the same with base 10. 10^-1 == 0.1. 1/9 isn't a power of 10, you you can't have an exact representation.

kccqzyyesterday at 3:34 PM

They shouldn’t “memorize” this per se, but it should take them only a few seconds to work out in their head.