BNS numbers

TAoKE appendix + interactive BNS explorer

\newpage \subsection*{Appendix BNS-Numbers}

BNS Numbers

BNS stands for BENSE-Numbering-System (invented and implemented in JavaScript by the author of this study in April 2013 based on his own ideas from the late 1990ies).  It represents numbers as strings and has the following advantages:

  • Numbers can have arbitraryly precision, which is only limited by the length of the string data type, where the numbers are stored.
  • BNS numbers can be compared by string comparision preserving the correct order of magnitude
  • There are only two Javascript functions for encoding and decoding BNS-numbers
  • The sequence of the digits is the same as in the orginial number, but BNS-numbers do not need trailing zeros for big integers oder leading zeros with numbers with amounts smaller than 1. No decimal point ist needed.
  • With the big range concept the two characters 0 and 9 stand for the absolutely smallest and biggest numbers. No other number representation known to us (besides Mathematicas concept of Infinity) so far allows to represent this.
BNS Number Representation

The number line is divided into 10 bigrange segments:

Negative numbers

  • 0 = represents the biggest negativ number
  • 1 = numbers smaller than -1050
  • 2 = numbers between -1050 and smaller than -100 = -1
  • 3 = numbers between -1 and smaller than -1-50
  • 4 = numbers between -1-50 and smaller than 0

Positive numbers

  • 5 = numbers between 0 and smaller than 10-50
  • 6 = numbers between 10-50 and smaller than 100 = 1
  • 7 = numbers between 100 smaller than 1050
  • 8 = numbers larger than 1050
  • 9 = represents the biggest positive number

The 8 bigrange segments 2 ... 8 are divided into 50 smallrange segments being represented by the characters 'ABCDEFGHIJKLMNOPQRSTUVWXYabcdefghijklmnopqrstuvwxy'. The small ranges allow to divide the big ranges into 50 different orders of magnitudes. So bigrange 7 and 8 can represent the numbers from 100 to 1099. If there is a need for larger exponents, this could be easily achieved by adding another small range character.

Negative BNS Numbers

To preserve the correct sorting order for negative number, the mantissa is mirrored towards the center of the subrange.

  • BnsNumber (-0.3) = 3B6
  • BnsNumber (-0.8) = 3B1
    =>
  • -0.3 > 0.8 and also 3B6 > 3B1

Another example

  • BnsNumber (-1005) = 2D8995
  • BnsNumber (-7500) = 2D75
    =>
  • -1005 > -7500 and also 2D8995 > 2D75
BNS Encoding Examples

In Table BNSEE typical examples of encoding numbers into BNS-numbers are given.

\newpage
\begin{landscape}
BNS Encoding Examples
BigRange 0 b 1 b 2 b 3 b 4 b 5 b 6 b 7 b 8 b 9
                                       
- ∞   0                                  
< -10^50     -1050 1A1                              
> -1         -1 2A1                          
-1 to -1^-50             -1^50 3A1                      
-1^-50 to Zero                 -1^50 4A1                  
Zero                    
0
5A0              
                          1e-50 6A0          
                          0.7 6B7          
                          0.00005 6F5          
>=1                             1 7A1      
Pi                            
3.141592
7A3141592      
                             
23.45
7B2345      
                             
100
7C1      
                              10000000 7H1      
>= 10^50                                 1e50 8A1  
                                    9
\newpage \end{landscape}

Extension: deriver.app

Interactive BNS tool: b2b-explorer.net — BNS Test (encode/decode, 256 hex intervals, lexicographic order). UI and help text on that site are largely in German.

Additional background: ontology4.us — BNS_Numbers (linked from the canonical appendix above).

Source: taoke.de — TAoKE Appendices — BNS Numbers.