benbusby/y2k

Float variable type

Closed this issue · 1 comments

This might be kinda clunky to implement, but is definitely needed.

One approach could be to specify the size of a float value as length+1, with the last digit used for placement of the decimal. So to store the number 3.14, you would set variable size to 4 and the last digit would be 1 (decimal after the first digit).

So if the float variable type was type 4, the full statement would look like:

  Begin creating variable
 /   Set Var ID to 1 
|  /  Set var Type to 4 (float)
| |  /  Set var Size to 4
| | |  /  Insert 3
| | | |  /  Insert 1
| | | | |  /  Insert 4
| | | | | |  /  Insert 1 (set decimal after first digit)
| | | | | | |  /
8 1 4 4 3 1 4 1

Implemented in ab560a8