lib: fix division by zero with >n basis
0.3.1