VOOZH about

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

⇱ Ruby | Float class - value - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Ruby | Float class - value

Last Updated : 8 Jan, 2020
Float#-() : -() is a Float class method in Ruby which return difference of two Float numbers.
Syntax:  Float.-()

Parameter: Float values

Return:  Difference of the two Float values
Code #1 : Example for -() method Output :
Float a - b : 199888.9

Float b - c : -199883.6

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

Float b - c : 10029.1

Float a - c : 27.13333333
Comment