public
Fork of jschementi/ironruby-stats
Description: Statistics for IronRuby
Homepage: http://ironruby.info
Clone URL: git://github.com/jredville/ironruby-stats.git
ironruby-stats / mymath.rb
100644 13 lines (11 sloc) 0.201 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
class Float
  def round_to(x)
    (self * 10**x).round.to_f / 10**x
  end
 
  def ceil_to(x)
    (self * 10**x).ceil.to_f / 10**x
  end
 
  def floor_to(x)
    (self * 10**x).floor.to_f / 10**x
  end
end