Courses
Tutorials
Practice
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
38.4K+ articles
DSA
22.5K+ articles
Python
20.5K+ articles
Experiences
16.6K+ articles
Interview Experiences
14.1K+ articles
JavaScript
11.7K+ articles
School Learning
11.4K+ articles
Ruby
1.2K+ articles
Ruby-Methods
926+ articles
Ruby Collections
144+ articles
Ruby Integer-class
49 posts
Recent Articles
Popular Articles
Ruby Integer size() function with example
Last Updated: 08 January 2020
The size() function in Ruby returns the number of bytes in the machine representation of int.Syntax: number.sizeParameter: The function takes the integer whose number of b...
read more
Ruby
Ruby-Methods
Ruby Integer-class
Ruby | Integer upto() function
Last Updated: 04 December 2020
The upto function in Ruby returns all the numbers from a given to number itself. It iterates the given block, passing in increasing values from number1 up to number2. If n...
read more
Ruby
Ruby-Methods
Ruby Collections
Ruby Integer-class
Ruby | Integer sqrt() function
Last Updated: 07 January 2020
The sqrt() function in Ruby returns the integer square root of the non-negative integer n, i.e. the largest non-negative integer less than or equal to the square root of n...
read more
Ruby
Ruby-Methods
Ruby Collections
Ruby Integer-class
Ruby Integer remainder() function with example
Last Updated: 03 December 2020
The remainder() function in Ruby returns the remainder when two numbers are divided. Syntax: (number1).remainder(number2)Parameter: The function takes two number number1 a...
read more
Ruby
Ruby-Methods
Ruby Integer-class
Ruby Integer prime? function with example
Last Updated: 03 December 2020
The prime? function in Ruby returns a boolean value. It returns true if the number is prime, else it returns false. It requires the 'prime' class to be pre-added. Syntax: ...
read more
Ruby
Ruby-Methods
Ruby Integer-class
Ruby Integer pred() function with example
Last Updated: 07 January 2020
The pred function in Ruby returns the immediate predecessor of the number, i.e., it returns number - 1. If a float value is used, it throws an error message. Syntax: numb...
read more
Ruby
Ruby-Methods
Ruby Integer-class
Ruby Integer truncate() function with example
Last Updated: 07 January 2020
The truncate() function in Ruby returns an int truncated value to a precision of ndigits decimal digits. When the precision is negative, the returned value is an integer w...
read more
Ruby
Ruby-Methods
Ruby Integer-class
Ruby Integer to_s function with example
Last Updated: 03 December 2020
The to_s function in Ruby returns a string containing the place-value representation of int with radix base (between 2 and 36). If no base is provided in the parameter the...
read more
Ruby
Ruby-Methods
Ruby Integer-class
Ruby Integer to_r function with example
Last Updated: 07 January 2020
The to_r function in Ruby converts the value of the number to a rational. Syntax: number.to_rParameter: The function takes the number which is to be converted to a rationa...
read more
Ruby
Ruby-Methods
Ruby Integer-class
Ruby Integer to_int function with example
Last Updated: 04 December 2020
The to_int function in Ruby converts the value of the number to int. If the number itself is an int, it returns self only. It is an alias of to_i function. Syntax: number....
read more
Ruby
Ruby-Methods
Ruby Collections
Ruby Integer-class
Ruby Integer to_i function with example
Last Updated: 07 January 2020
The to_i function in Ruby converts the value of the number to int. If the number itself is an int, it returns self only. Syntax: number.to_iParameter: The function takes t...
read more
Ruby
Ruby-Methods
Ruby Integer-class
Ruby Integer to_f function with example
Last Updated: 07 January 2020
The to_f function in Ruby converts the value of the number as a float. If it does not fit in float, then it returns infinity. Syntax: number.to_f Parameter: The function t...
read more
Ruby
Ruby-Methods
Ruby Integer-class
Ruby Integer to_d() function with example
Last Updated: 07 January 2020
The to_d function in Ruby converts the value of int as a BigDecimal.Syntax: number.to_d Parameter: The function takes the integer which is to be converted to BigDecimal.Re...
read more
Ruby
Ruby-Methods
Ruby Integer-class
Ruby Integer times function with example
Last Updated: 17 March 2020
The times function in Ruby returns all the numbers from 0 to one less than the number itself. It iterates the given block, passing in increasing values from 0 up to the li...
read more
Ruby
Ruby-Methods
Ruby Integer-class
Ruby Integer succ() function with example
Last Updated: 03 December 2020
The succ function in Ruby returns the immediate successor of the number, i.e., it returns number + 1. If a float value is used, it throws an error message. Syntax: number....
read more
Ruby
Ruby-Methods
Ruby Integer-class
1
2
3
4
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !