calculate pos from value to prevent rounding errors