Here you can find the source of clip2(double n, double d, double[] t)
private static boolean clip2(double n, double d, double[] t)
//package com.java2s; /*//from w ww .j av a2 s. c o m * Copyright (c) 2012 Diamond Light Source Ltd. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ public class Main { private static boolean clip2(double n, double d, double[] t) { if (d == 0) { return n <= 0; } double v = n / d; if (d > 0) { if (v > t[1]) return false; } else { if (v < t[1]) t[1] = v; } return true; } }