I understand the ZX80 and 81 are simple machine. What I do not understand is the 32768 limitation and how it affects programs. The Apple II had this issue, making it hard to program business programs. What I want to know is Why?

please help a confused novice programmer

## What is so bad about using Floating Point math in a BASIC program

### What is so bad about using Floating Point math in a BASIC program

zx81: great yet flawed

Zx spectrum: masterpiece that keeps on giving

(wish it weren't so expensive)

Zx spectrum: masterpiece that keeps on giving

(wish it weren't so expensive)

### Re: What is so bad about using Floating Point math in a BASIC program

It is slow, even in the display of a number.

I recently coded USCII and ran the same program in pure ZX81 BASIC and with USCII which only does a different way of displaying a number.

It only accepts a positive rounded number to be printed. Even with this change only the ZX81 BASIC is twice as fast as normal BASIC.

https://www.youtube.com/watch?v=rwzcrSbIJkk

I recently coded USCII and ran the same program in pure ZX81 BASIC and with USCII which only does a different way of displaying a number.

It only accepts a positive rounded number to be printed. Even with this change only the ZX81 BASIC is twice as fast as normal BASIC.

https://www.youtube.com/watch?v=rwzcrSbIJkk

### Re: What is so bad about using Floating Point math in a BASIC program

but how exactly is it slow? I can see the video just fine. my question concerns the hardware. for instance, creating a business application using just FP numbers and no Integers. how would they be different, what would the change look like when run?

zx81: great yet flawed

Zx spectrum: masterpiece that keeps on giving

(wish it weren't so expensive)

Zx spectrum: masterpiece that keeps on giving

(wish it weren't so expensive)

- 1024MAK
**Posts:**2470**Joined:**Mon Sep 26, 2011 10:56 am**Location:**Looking forward to summer in Somerset, UK...

### Re: What is so bad about using Floating Point math in a BASIC program

If you had to take a child to school by road, would you use a gas guzzling posh 4x4 or a fuel efficient modern small car?

Floating point numbers are the “jack of all trades” and can cope with a very wide range of numbers. But there are some potential disadvantages. They only store approximations (because internally in a computer all numbers are stored as binary digits, and converting from/to decimal can result in rounding errors), they take up more bytes of memory than simpler integral numbers, it takes time for the computer to convert from/to a floating point number, or to carry out mathematical operations on a floating point number.

Integral numbers are more limited. They also have various disadvantages, but have some advantages. Within the range, whole (integral decimal numbers convert very easily to/from binary. They are faster to process when adding or subtracting etc. They take up less memory.

They come in a number of different types:

One byte can store a decimal number between 0 and 255, or between -128 and +127 depending on how the the operator handles the number.

Two bytes can store a decimal number between 0 and 65535, or between -32768 and +32767 depending on how the the operator handles the number.

There are larger ranges available on computers with more memory.

Floating point numbers are the “jack of all trades” and can cope with a very wide range of numbers. But there are some potential disadvantages. They only store approximations (because internally in a computer all numbers are stored as binary digits, and converting from/to decimal can result in rounding errors), they take up more bytes of memory than simpler integral numbers, it takes time for the computer to convert from/to a floating point number, or to carry out mathematical operations on a floating point number.

Integral numbers are more limited. They also have various disadvantages, but have some advantages. Within the range, whole (integral decimal numbers convert very easily to/from binary. They are faster to process when adding or subtracting etc. They take up less memory.

They come in a number of different types:

One byte can store a decimal number between 0 and 255, or between -128 and +127 depending on how the the operator handles the number.

Two bytes can store a decimal number between 0 and 65535, or between -32768 and +32767 depending on how the the operator handles the number.

There are larger ranges available on computers with more memory.

*Mark*