VOOZH about

URL: https://www.geeksforgeeks.org/ruby/ruby-float-class-value-5/

⇱ Ruby | Float class % value - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Ruby | Float class % value

Last Updated : 7 Jan, 2020
Float#%() : %() is a Float class method in Ruby which return the modulo of two Float division.
Syntax:  Float.%()

Parameter: Float values - dividend and divisor

Return:  Modulo / Remainder
Code #1 : Example for %() method Output :
Float a % b : -111.10000000000001

Float b % c : -24.799999999990234

Float a % c : -5.299999999999997
Code #2 : Example for %() method Output :
Float a % b : 9943.76666667

Float b % c : -10.400000000000489

Float a % c : -29.1
Comment