
=== 1. an int32 is 32 bits read as a number around a ring ===
    2147483647  ->  wrap32 gives   2147483647   bits 01111111111111111111111111111111
    2147483648  ->  wrap32 gives  -2147483648   bits 10000000000000000000000000000000
   -2147483649  ->  wrap32 gives   2147483647   bits 01111111111111111111111111111111
    4294967301  ->  wrap32 gives            5   bits 00000000000000000000000000000101
    2147488281  ->  wrap32 gives  -2147479015   bits 10000000000000000001001000011001
numpy int32 agrees: True

=== 2. floats: sign, exponent, fraction ===
       1.0  0 01111111 00000000000000000000000
   0.15625  0 01111100 01000000000000000000000
      -2.5  1 10000000 01000000000000000000000
       0.1  0 01111011 10011001100110011001101
       0.0  0 00000000 00000000000000000000000
      -0.0  1 00000000 00000000000000000000000
       inf  0 11111111 00000000000000000000000
       nan  0 11111111 10000000000000000000000
     1e-45  0 00000000 00000000000000000000001
0.1 as float32 is exactly 0.10000000149011612  0.1 as a python float is exactly 0.100000000000000005551115123126
exact decimal value of float32 0.1: 0.100000001490116119384765625000

=== 3. rounding ===
python 0.1 + 0.2 = 0.30000000000000004   float32: 0.30000001192092896 (printed with %.9g: 0.300000012)
2**24 + 1 in float32 = 16777216   2**24 + 2 = 16777218
gap between neighbours at 1.0: 1.1920928955078125e-07  at 1e6: 0.0625  at 1e10: 1024.0
(1e8 + 1) - 1e8 in float32 = 0.0 (the 1 is lost, the gap at 1e8 is 8)
(a+b)+c = 1.0    a+(b+c) = 0.0    with a=1e8, b=-1e8, c=1

=== 4. special values ===
nan == nan: False   nan != nan: True   nan < 1: False   nan > 1: False
0.0 == -0.0: True   but 1/0.0 and 1/-0.0 are inf and -inf  (copysign shows the sign: -1.0 )
max(nan, 1) in python: nan   max(1, nan): 1   (a > b ? a : b) rule: nan>1 is false so gives 1; 1>nan false so gives nan
inf - inf = nan   0 * inf = nan

=== 5. division: three conventions on -7 and 2 ===
truncate toward zero (C):          -3  remainder -1.0
floor (python //, our FLOORDIV):   -4  remainder 1
our floordiv/floormod on (-7, 2):  -4 1
python 7 // -2 = -4   7 % -2 = -1  (the remainder takes the sign of the divisor)
identity a == b*(a//b) + a%b over a in [-20,20], b in [-5,5], b!=0: True
x//0 and x%0 under our contract: 0 7   INT_MIN // -1: -2147483648

=== 6. casts ===
cast f32->i32 of           3.99 =            3
cast f32->i32 of          -3.99 =           -3
cast f32->i32 of  10000000000.0 =   2147483647
cast f32->i32 of -10000000000.0 =  -2147483648
cast f32->i32 of            nan =            0
cast f32->i32 of            inf =   2147483647
cast f32->i32 of   2147483520.0 =   2147483520
cast f32->i32 of   2147483648.0 =   2147483647
numpy float32(2**31).astype(int32), the raw x86 result that C leaves undefined: -2147483648
i32 -> f32 of 16777217: 16777216 (not exactly representable)
