All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.uqbar.geodds.NumberUtils Maven / Gradle / Ivy

The newest version!
package org.uqbar.geodds;

/**
 * Clase helper para números.
 * 
* Se debe importar como static extension methods, eso permite incorporar mensajes * a los números de la forma
*
    *
  • 2.max(5)
    *
  • 6.even
    *
* etc.

* * @author DDS */ @SuppressWarnings("all") public class NumberUtils { /** * Devuelve el menor valor entre dos números */ public static double min(final double x, final double y) { double _xifexpression = (double) 0; if ((x < y)) { _xifexpression = x; } else { _xifexpression = y; } return _xifexpression; } /** * Devuelve el mayor valor entre dos números */ public static double max(final double x, final double y) { double _xifexpression = (double) 0; if ((x > y)) { _xifexpression = x; } else { _xifexpression = y; } return _xifexpression; } /** * Indica si un número es par */ public static boolean even(final int x) { return ((x % 2) == 0); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy