Linear formula to predict ideal position of a marker.

@param int $i index of marker to adjust
@param int $d always -1 or 1
@return float ideal height of marker
8645
private function computeLinear( $i, $d ) {
		$q = $this->heights[$i];
		$n = $this->positions[$i];
		return ( $q + $d *
			( $this->heights[$i + $d] - $q ) /
			( $this->positions[$i + $d] - $n )
		);
	}
315449
private function _height(?IBinaryNode $node): int {
        if (null === $node) {
            return 0;
        }
        return 1 + \max($this->_height($node->getLeft()), $this->_height($node->getRight()));
    }
1096931
public function toNanos($d)
    {
        $v = $this->getValue();
        return $this->x($d, $this->{'c'.$v}/$this->c0, PHP_INT_MAX/($this->{'c'.$v}/$this->c0));
    }
843525
public function getPointByDirection($direction, $width = 0, $height = 0) {
		if (empty($width) || empty($height)) {
			$width = $this->getWidth() / 3;
			$height = $this->getHeight() / 3;
			return array(
				$direction % 3 * $width,
				$direction / 3 * $height,
				$width,
				$height
			);
		}
		switch ($direction) {
			case self::Center:
				return array(
					($this->getWidth() - $width) / 2,
					($this->getHeight() - $height) / 2,
					$width,
					$height
				);
			case self::Left:
				return array(
					0,
					($this->getHeight() - $height) / 2,
					$width,
					$height
				);
			case self::Top:
				return array(
					($this->getWidth() - $width) / 2,
					0,
					$width,
					$height
				);
			case self::RightTop:
				return array(
					$this->getWidth() - $width,
					0,
					$width,
					$height
				);
			case self::Right:
				return array(
					$this->getWidth() - $width,
					($this->getHeight() - $height) / 2,
					$width,
					$height
				);
			case self::RightBottom:
				return array(
					$this->getWidth() - $width,
					$this->getHeight() - $height,
					$width,
					$height
				);
			case self::Bottom:
				return array(
					($this->getWidth() - $width) / 2,
					$this->getHeight() - $height,
					$width,
					$height
				);
			case self::LeftBottom:
				return array(
					0,
					$this->getHeight() - $height,
					$width,
					$height
				);

			case self::LeftTop:
			default:
				return array(
					0,
					0,
					$width,
					$height
				);
		}
	}
330728
void setPrecisionUnit(int i) {
        if (upperBound[i] > lowerBound[i]) {
            double digits = Math.log10(Math.abs(upperBound[i] - lowerBound[i]));
            double residual = digits - Math.floor(digits);
            if (residual < 0.2) {
                // If the range is less than 15 units, we reduce one level.
                digits -= 1.0;
            }

            precisionDigits[i] = (int) Math.floor(digits);
            precisionUnit[i] = Math.pow(10, precisionDigits[i]);

            if (residual >= 0.2 && residual <= 0.7) {
                // In case of too few grids, we use a half of precision unit.
                precisionUnit[i] /= 2;
                precisionDigits[i] -= 1;
            }
        } else {
            precisionUnit[i] = 0.1;
        }
    }
605860
function fixLineheight($v)
	{
		$lh = false;
		if (preg_match('/^[0-9\.,]*$/', $v) && $v >= 0) {
			return ($v + 0);
		} elseif (strtoupper($v) == 'NORMAL' || $v == 'N') {
			return 'N';  // mPDF 6
		} else {
			$tlh = $this->sizeConverter->convert($v, $this->FontSize, $this->FontSize, true);
			if ($tlh) {
				return ($tlh . 'mm');
			}
		}
		return $this->normalLineheight;
	}
92393
public static function size_varint($i) {
/*		$len = 0;
		do {
			$i = $i >> 7;
			$len++;
		} while ($i != 0);
		return $len;
*/
		// TODO Change to a binary search
		if ($i < 0x80)
			return 1;
		if ($i < 0x4000)
			return 2;
		if ($i < 0x200000)
			return 3;
		if ($i < 0x10000000)
			return 4;
		if ($i < 0x800000000)
			return 5;
		if ($i < 0x40000000000)
			return 6;
		if ($i < 0x2000000000000)
			return 7;
		if ($i < 0x100000000000000)
			return 8;
		if ($i < 0x8000000000000000)
			return 9;
	}
47940
protected double derivative(int i, NumberVector v) {
    final int dim = v.getDimensionality();
    if(dim == 1) {
      return 0.;
    }
    // Adjust for boundary conditions, as per the article:
    i = (i == 0) ? 1 : (i == dim - 1) ? dim - 2 : i;
    return (v.doubleValue(i) - v.doubleValue(i - 1) + (v.doubleValue(i + 1) - v.doubleValue(i - 1)) * .5) * .5;
  }
717176
protected function getNextMarker(&$i, &$sofStartRead)
	{
		$this->skipStartPadding($i, $sofStartRead);

		do {
			if ($i >= $this->dataLength)
			{
				return self::JPEG_EOI_MARKER;
			}
			$marker = $this->data[$i];
			$i++;
		} while ($marker == self::SOF_START_MARKER);

		return $marker;
	}
876289
public function getFootnotesHeight(): float
    {
        $h = 0;
        foreach ($this->printedfootnotes as $element) {
            $h += $element->getHeight($this);
        }

        return $h;
    }
744999
public static function round($i, $precision = 0){

		$precision = pow(10,$precision);
		$i = $i*$precision;

		$ceil = ceil($i);
		$floor = floor($i);
		if( ($ceil - $i) <= ($i - $floor) ){
			return $ceil/$precision;
		}else{
			return $floor/$precision;
		}
	}
114316
private static double coverRadius(double[][] matrix, int[] idx, int i) {
    final int idx_i = idx[i];
    final double[] row_i = matrix[i];
    double m = 0;
    for(int j = 0; j < row_i.length; j++) {
      if(i != j && idx_i == idx[j]) {
        final double d = row_i[j];
        m = d > m ? d : m;
      }
    }
    return m;
  }
705715
public void set(int i, T label2, float d) {
		labels[i] = label2;
		scores[i] = d;		
	}
567711
private function _optArg($i, $a)
    {
        if (-1 == ($ind = $this->_argindex($i, $a))) {
            return 0;
        }
        return $a[$ind];
    }
880471
public function get($i)
    {
        if (!isset($this->fragments[$i])) {
            return null;
        }

        if (
            !isset($this->halved[$i])   // not halved
            || !$this->fragments[$i]    // not set
            || !isset($this->sizes[$i]) // no solvable
        ) {
            return $this->fragments[$i];
        }

        $half = (int)floor($this->sizes[$i] / 2);

        $value = $this->fragments[$i];

        // Special case for g & h formats handling : if value is the same
        // as the half, which is not a possible value due to division,
        // ti means it is 0
        if ($value === $half) {
            $value = 0;
        }

        if ($this->halved[$i]) {
            $value += $half;
        }

        return $value;
    }
853209
public function &get_column($i)
    {
        if (!isset($this->_columns[$i])) {
            $this->_columns[$i] = array(
                "x"          => 0,
                "min-width"  => 0,
                "max-width"  => 0,
                "used-width" => null,
                "absolute"   => 0,
                "percent"    => 0,
                "auto"       => true,
            );
        }

        return $this->_columns[$i];
    }
1331445
private int getPadForLabel(int i) {
        Dictionary dictionary = slider.getLabelTable();
        int pad = 0;

        Object o = dictionary.get(i);
        if (o != null) {
            Component c = (Component) o;
            int centerX = xPositionForValue(i);
            int cHalfWidth = c.getPreferredSize().width / 2;
            if (centerX - cHalfWidth < insetCache.left) {
                pad = Math.max(pad, insetCache.left - (centerX - cHalfWidth));
            }

            if (centerX + cHalfWidth > slider.getWidth() - insetCache.right) {
                pad = Math.max(pad, (centerX + cHalfWidth) - (slider.getWidth() - insetCache.right));
            }
        }
        return pad;
    }