my agenda here is I'm trying to come up with some rough guidelines to help people understand when it makes sense to use floating point and when it doesn't.
So far I have "if your code is doing statistics/trigonometry/calculus/square roots, you probably want floating point! But if not... consider an integer instead". I think it still needs more nuance but it's a start.
I would like people on here to stop telling me facts about computers in 1985 -- I'm interested in talking about how computers work *today*, not the commodore 64 or whatever
(I actually think I would find retro computing stuff cool if everyone had an old computer museum in their city where you could play around with all those old computers yourself, but that just isn't the case.
the living computer museum in seattle was so fun but it looks like it's closed indefinitely
Using computers is fun, but listening to stories about an old computer that I'll never have the opportunity to use is pretty boring)
is there something else I'm missing? I'm looking for very basic fundamental things (like "strings"), not like images/video. Data structures like hashmaps seem tricky because there are so many different implementations
I think the list of languages that *don't* have integer overflow might be shorter actually. From quick research:
* Python 3 and Ruby's integer types are big integers (they get as big as can fit in memory) * JS numbers are floating point, which causes different problems (but not integer overflow). JS has big integers too though. * large PHP integers convert to floating point (similarly, can cause problems but not integer overflow) * (from the replies) lots of functional languages have big ints
we talked last week about what can go wrong with floating point numbers, so -- what can go wrong when using integers?
so far I have:
* 32 bit integers are smaller than you think (they only go up to 4 billion!) * overflow * sometimes you need to switch the byte order * ?? (maybe something about shift / bitwise operations? not sure what can go wrong with that exactly)
I'd especially love real-world examples of things that have gone wrong, if you have them!