Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Density
- include Enumerable
- extend Forwardable
- attr_accessor :uniform, :fail, :exact, :d
- def_delegators :@d, :each, :[], :[]=, :inspect, :delete
- def initialize(num=0)
- @d=Hash.new(Rational(0))
- @d[num]=Rational(1)
- @uniform=true
- @exact=true
- @fail=false
- end
- ... (many things, e.g. +() operator
- end
Advertisement
Add Comment
Please, Sign In to add comment