4 ms·
> "for some reason decided not to make integer types available to programmers...It's like they were going out of their way to make BASIC as slow as possible."
by em3rgent0rdr 2y ago
> "for some reason decided not to make integer types available to programmers...It's like they were going out of their way to make BASIC as slow as possible."
BASIC was well-intention to make programming easy, so ordinary people in non-technical fields, students, so people who weren't "programmers" could grasp. In order to make it easy, you better not try to scare adopters with concepts like int vs float and maximum number size and overflow, etc. The ordinary person's concept of a number fits in what computers call a float. You make a good point though that BCD strings might have done the trick better as a one-size fits all number format that might have been faster.
BASIC also wasn't intended for computationally intense things like serious number crunching, which back in the day usually was done in assembly anyway. The latency to perform arithmetic on a few floats (which is what your typical basic program deals with) is still basically instantaneous from the user's perspective even on a 1 MHz 8-bit CPU.
- scarface_74 2y agoThe 6502 ironically enough did support BCD strings directly http://www.6502.org/tutorials/decimal_mode.html http://www.6502.org/tutorials/decimal_mode.html