Ruby proporciona una variedad de métodos incorporados que puedes usar en los números. La siguiente es una lista incompleta de métodos [enteros](https://ruby-doc.org/core-2.2.0/Integer.html) y [flotantes](https://ruby-doc.org/core-2.2.0/Float.html#method-i-ceil) .
Utilizar `.even?` para comprobar si un [**número entero**](https://ruby-doc.org/core-2.2.0/Integer.html) es par. Devuelve un **booleano**`true` o `false` .
Utilizar `.odd?` para comprobar si un [**número entero**](https://ruby-doc.org/core-2.2.0/Integer.html) es impar o no. Devuelve un **booleano**`true` o `false` .
Las rondas del método `.ceil` [**flotan**](https://ruby-doc.org/core-2.2.0/Float.html#method-i-ceil) **hasta** el número más cercano. Devuelve un [**entero**](https://ruby-doc.org/core-2.2.0/Integer.html) .
Las rondas del método `.floor` [**flotan**](https://ruby-doc.org/core-2.2.0/Float.html#method-i-ceil) **hacia abajo** hasta el número más cercano. Devuelve un [**entero**](https://ruby-doc.org/core-2.2.0/Integer.html) .
Utilice `.pred` para devolver el [**entero**](https://ruby-doc.org/core-2.2.0/Integer.html) consecutivo anterior.
```Ruby
15.pred #=> 14
2.pred #=> 1
(-4).pred #=> -5
```
## [A la cuerda](https://ruby-doc.org/core-2.4.2/Object.html#method-i-to_s) :
El uso de `.to_s` en un número ( [**entero**](https://ruby-doc.org/core-2.2.0/Integer.html) , [**flotadores**](https://ruby-doc.org/core-2.2.0/Float.html#method-i-ceil) , etc.) devuelve una [cadena](https://ruby-doc.org/core-2.2.0/String.html) de ese número.
```Ruby
15.to_s #=> "15"
3.4.to_s #=> "3.4"
```
## [El mayor denominador común](https://ruby-doc.org/core-2.2.0/Integer.html#method-i-gcd) :
El método `.gcd` proporciona el mayor divisor común (siempre positivo) de dos números. Devuelve un [**entero**](https://ruby-doc.org/core-2.2.0/Integer.html) .
Utilice `.round` para devolver un [**entero**](https://ruby-doc.org/core-2.2.0/Integer.html) redondeado o un [**flotador**](https://ruby-doc.org/core-2.2.0/Float.html) .