QP School
QP School
>
Tutorials
>
Ruby 3 Tutorials, exercises and examples
> Predecessor in Ruby
Full Version:
Predecessor in Ruby
You're currently viewing a stripped down version of our content.
View the full version
with proper formatting.
Qomplainerz
02-28-2021, 10:31 AM
If you want to get the predecessor of a number in Ruby you can do it as follows:
Quote:
puts 1.pred
This will print 0 on the screen
QP School
>
Tutorials
>
Ruby 3 Tutorials, exercises and examples
> Predecessor in Ruby