Skip to content

FormulaPages/address-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

address system

The address system maps a two dimensional table to a single dimension.

The cell index encodes both the row and the column into a single integer.

The cell index is a value between 0 and 17179869183.

The max value is the binary number '1111111111111111111111111111111111'.

The first 20 bits from left-to-right are the row index; from 0...MAX_ROWS-1.

The remaining 14 bits are the column index; from 0...MAX_COLS-1.

functions

  1. CELLINDEX(row, col)
  2. INDEX2ROW(index)
  3. INDEX2COL(index)

caveats

Since JavaScript doesn't have an unsigned shift left I was forced to resort to multiplication which is less efficient but will have to do. If you can do fast binary math in JavaScript then please send me a pull request.

About

The core address system functions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published