/*
 * Copyright 2011-2023 MicroEJ Corp. All rights reserved.
 * This library is provided in source code for use, modification and test, subject to license terms.
 * Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
 */
package ej.bon;

/**
 * This class provides advanced mathematical functions.
 */
public final class XMath {

    /**
     * Limits a value between two others:
     * <ol>
     * <li>If <code>value</code> is lower than <code>min</code>, returns
     * <code>min</code>.</li>
     * <li>If <code>value</code> is greater than <code>max</code>, returns
     * <code>max</code>.</li>
     * <li>Otherwise, returns <code>value</code>.</li>
     * </ol>
     *
     * @param value
     *            the value to limit
     * @param min
     *            the lower bound
     * @param max
     *            the upper bound
     * @return the limited value
     * @throws IllegalArgumentException
     *             if <code>min</code> is greater than <code>max</code>
     */
    public static int limit(int value, int min, int max) {
        throw new RuntimeException();
    }

    /**
     * Limits a value between two others:
     * <ol>
     * <li>If <code>value</code> is lower than <code>min</code>, returns
     * <code>min</code>.</li>
     * <li>If <code>value</code> is greater than <code>max</code>, returns
     * <code>max</code>.</li>
     * <li>Otherwise, returns <code>value</code>.</li>
     * </ol>
     *
     * @param value
     *            the value to limit
     * @param min
     *            the lower bound
     * @param max
     *            the upper bound
     * @return the limited value
     * @throws IllegalArgumentException
     *             if <code>min</code> is greater than <code>max</code>
     */
    public static float limit(float value, float min, float max) {
        throw new RuntimeException();
    }

    /**
     * Limits a value between two others:
     * <ol>
     * <li>If <code>value</code> is lower than <code>min</code>, returns
     * <code>min</code>.</li>
     * <li>If <code>value</code> is greater than <code>max</code>, returns
     * <code>max</code>.</li>
     * <li>Otherwise, returns <code>value</code>.</li>
     * </ol>
     *
     * @param value
     *            the value to limit
     * @param min
     *            the lower bound
     * @param max
     *            the upper bound
     * @return the limited value
     * @throws IllegalArgumentException
     *             if <code>min</code> is greater than <code>max</code>
     */
    public static long limit(long value, long min, long max) {
        throw new RuntimeException();
    }

    /**
     * Limits a value between two others:
     * <ol>
     * <li>If <code>value</code> is lower than <code>min</code>, returns
     * <code>min</code>.</li>
     * <li>If <code>value</code> is greater than <code>max</code>, returns
     * <code>max</code>.</li>
     * <li>Otherwise, returns <code>value</code>.</li>
     * </ol>
     *
     * @param value
     *            the value to limit
     * @param min
     *            the lower bound
     * @param max
     *            the upper bound
     * @return the limited value
     * @throws IllegalArgumentException
     *             if <code>min</code> is greater than <code>max</code>
     */
    public static double limit(double value, double min, double max) {
        throw new RuntimeException();
    }
    // not implemented in icetea -> not available in api
    // public static double atan2(double a, double b) {
    // throw new RuntimeException();
    // }
    //
    // public static double cbrt(double a) {
    // throw new RuntimeException();
    // }
    //
    // public static double hypot(double a, double b) {
    // throw new RuntimeException();
    // }
    //
    // public static double log10(double a) {
    // throw new RuntimeException();
    // }
    //
    // public static double cosh(double a) {
    // throw new RuntimeException();
    // }
    //
    // public static double sinh(double a) {
    // throw new RuntimeException();
    // }
    //
    // public static double tanh(double a) {
    // throw new RuntimeException();
    // }
}
