# Vyper binary fixed point vs Decimal fixed point

there is something i do not understand in Vyper documentation:

Binary fixed point: Decimal fixed point is better, because any decimal fixed point value written as a literal in code has an exact representation, whereas with binary fixed point approximations are often required (e.g. (0.2)10 = (0.001100110011…)2, which needs to be truncated), leading to unintuitive results, e.g. in Python 0.3 + 0.3 + 0.3 + 0.1 != 1.

They talk about "binary fixed point" and "Decimal fixed point". I do not understand the difference between.

For me there are 2 technologies: Floating point and Fixed point.

What i have understood is Vyper works with fixed point technology.

I do not understand why they are talking about "Binary" and "Decimal" fixed point.

Thanks a lot

You can use base 2 or base 10 number for your fixed-point mathematics.

For fiat currency financial calculations base 10 makes sense, as you get nice round cents like \$102.13 instead of e.g. \$102.1222222222222229.

Alternatively, we can have unit be a power of two. This has two big benefits: We can use shifts instead of multiplications and divisions, which are cheaper in gas (see note at the end!). The numbers are easier to reason about regarding ranges and overflow protection, making the library simpler/safer.

The downside is our numbers will no longer behave like decimal point numbers. For example, if unit = 2^2 = 4, then the smallest number would be 0.25, not 0.1 or 0.01. I’d argue however that this value will be so small that this won’t be an issue.