def _compensate_pressure(self, adc_p):
        """Compensate pressure.

        Formula from datasheet Bosch BME280 Environmental sensor.
        8.1 Compensation formulas in double precision floating point
        Edition BST-BME280-DS001-10 | Revision 1.1 | May 2015.
        """
        var_1 = (self._temp_fine / 2.0) - 64000.0
        var_2 = ((var_1 / 4.0) * (var_1 / 4.0)) / 2048
        var_2 *= self._calibration_p[5]
        var_2 += ((var_1 * self._calibration_p[4]) * 2.0)
        var_2 = (var_2 / 4.0) + (self._calibration_p[3] * 65536.0)
        var_1 = (((self._calibration_p[2]
                   * (((var_1 / 4.0) * (var_1 / 4.0)) / 8192)) / 8)
                 + ((self._calibration_p[1] * var_1) / 2.0))
        var_1 /= 262144
        var_1 = ((32768 + var_1) * self._calibration_p[0]) / 32768

        if var_1 == 0:
            return 0

        pressure = ((1048576 - adc_p) - (var_2 / 4096)) * 3125
        if pressure < 0x80000000:
            pressure = (pressure * 2.0) / var_1
        else:
            pressure = (pressure / var_1) * 2

        var_1 = (self._calibration_p[8]
                 * (((pressure / 8.0) * (pressure / 8.0)) / 8192.0)) / 4096
        var_2 = ((pressure / 4.0) * self._calibration_p[7]) / 8192.0
        pressure += ((var_1 + var_2 + self._calibration_p[6]) / 16.0)

        return pressure / 100
Compensate pressure.

        Formula from datasheet Bosch BME280 Environmental sensor.
        8.1 Compensation formulas in double precision floating point
        Edition BST-BME280-DS001-10 | Revision 1.1 | May 2015.