Decimal Representation in YOLOL

riley

Learned-to-sprint endo
Joined
Jan 23, 2020
Messages
24
#1
On the wiki it states YOLOL numbers are represented as 64 bit fixed point decimals and can store up to 3 decimal places. Looking at the maximum and minimum values it's obvious to see that the underlying representation is a signed 64 bit integer.

With that representation how can decimal calculations be achieved given that multiplication won't work as expected with the decimal values, eg:

Code:
a = 0.500
b = 1.000

c = a * b //Expected to be 0.500
c == 500.000 //If we just use multiplication on signed integers
Is the multiplication result pushed into a 128 bit integer then shifted right by 3 decimal places? If so why not scale the result in base 2 to make potential calculations faster? Why not just use a floating point representation instead?
 
Top