Ruby | Numeric conjugate() function
The conjugate() is an inbuilt method in Ruby returns the number itself.
Syntax: num1.conjugate()
Parameters: The function needs a number.
Return Value: It returns itself only.
Example 1:
# Ruby program for conjugate() method in Matrix
# Initialize a number
num1 = 1.7
# Function used
num = num1.conjugate()
# Prints conjugate() of num
puts num
|
Output:
1.7
Example 2:
# Ruby program for conjugate() method in Matrix
# Initialize a number
num1 = 19
# Function used
num = num1.conjugate()
# Prints conjugate() of num
puts num
|
Output:
19
Last Updated :
19 Mar, 2024
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...