Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
bondarchuk
on June 5, 2020
|
parent
|
context
|
favorite
| on:
Edge of Emulation: Game Boy Sewing Machines
I'm not sure I get it, can you give an example of "index into a table of linearly increasing values"?
jcelerier
on June 5, 2020
[–]
say you want to represent values going from -10 to 10 with a step of 2 you'll have an array which is
int array[]{-10, -8, -6, -4, -2, 0, 2, 4, 6, 8, 10};
-> "0" is 6 in that case and you only need 4 bits to store your index. In addition in hardware it's somewhat common to have definitely non symmetrical ranges, e.g. from -20 to 150 or things like that.
bondarchuk
on June 5, 2020
|
parent
[–]
Aha, thanks for the explanation!
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: