Horje
Ruby | Numeric conj() function

The conj() is an inbuilt method in Ruby returns the number itself. 

Syntax: num1.conj()

Parameters: The function needs a number. 

Return Value: It returns itself only.

Example 1:  

Ruby

# Ruby program for conj() method in Numeric
  
# Initialize a number 
num1 = 1.7
  
# Function used
num = num1.conj()
  
# Prints conj() of num
puts num

Output

1.7

Example 2

Ruby

# Ruby program for conj() method in Numeric
  
# Initialize a number 
num1 = 19
  
# Function used
num = num1.conj()
  
# Prints conj() of num
puts num

Output

19

 




Reffered: https://www.geeksforgeeks.org


Ruby

Related
Ruby | Numeric conjugate() function Ruby | Numeric conjugate() function
Ruby | Numeric denominator() function Ruby | Numeric denominator() function
Ruby | Numeric div() function Ruby | Numeric div() function
Ruby | Numeric divmod() function Ruby | Numeric divmod() function
Ruby | Numeric eql?() function Ruby | Numeric eql?() function

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
8