I want to save a rational number 3/12
in a variable using this code:
rNo = Rational(3, 12)
# => 1/4
but ruby reduces the number to 1/4
.
Can anybody please tell me how to keep the numbers as I write them?
I want to save a rational number 3/12
in a variable using this code:
rNo = Rational(3, 12)
# => 1/4
but ruby reduces the number to 1/4
.
Can anybody please tell me how to keep the numbers as I write them?
Copyright © 2021 Jogjafile Inc.