Example usage for org.apache.commons.math3.util FastMath nextUp

List of usage examples for org.apache.commons.math3.util FastMath nextUp

Introduction

In this page you can find the example usage for org.apache.commons.math3.util FastMath nextUp.

Prototype

public static float nextUp(final float a) 

Source Link

Document

Compute next number towards positive infinity.

Usage

From source file:it.unibo.alchemist.model.implementations.environments.Continuous2DEnvironment.java

/**
 * Allows to extend the size of the environment by adding some object.
 * /* w w  w .j av  a2 s . c om*/
 * @param startx
 *            minimum x position of the object
 * @param endx
 *            maximum x position of the object
 * @param starty
 *            minimum y position of the object
 * @param endy
 *            maximum y position of the object
 */
protected final void includeObject(final double startx, final double endx, final double starty,
        final double endy) {
    if (startx < minX) {
        minX = FastMath.nextDown(startx);
    }
    if (starty < minY) {
        minY = FastMath.nextDown(starty);
    }
    if (endx > maxX) {
        maxX = FastMath.nextUp(endx);
    }
    if (endy > maxY) {
        maxY = FastMath.nextUp(endy);
    }
    assert minX < maxX;
    assert minY < maxY;
}