lib/rdf/model/literal/double.rb in rdf-3.1.6 vs lib/rdf/model/literal/double.rb in rdf-3.1.7
- old
+ new
@@ -179,14 +179,14 @@
def abs
(f = to_f) && f > 0 ? self : self.class.new(f.abs)
end
##
- # Returns the integer with no fractional part that is closest to the argument. If there are two such numbers, then the one that is closest to positive infinity is returned. An error is raised if arg is not a numeric value.
+ # Returns the number with no fractional part that is closest to the argument. If there are two such numbers, then the one that is closest to positive infinity is returned. An error is raised if arg is not a numeric value.
#
- # @return [RDF::Literal::Integer]
+ # @return [RDF::Literal::Double]
def round
- RDF::Literal::Integer.new(to_f.round)
+ self.class.new(to_d.round(half: (to_d < 0 ? :down : :up)))
end
##
# Returns `true` if the value is zero.
#