4 module Puppet::Parser::Functions
5 newfunction(:ceiling, :type => :rvalue, :doc => <<-DOC
6 Returns the smallest integer greater or equal to the argument.
7 Takes a single numeric value as an argument.
9 Note: from Puppet 6.0.0, the compatible function with the same name in Puppet core
10 will be used instead of this function.
14 raise(Puppet::ParseError, "ceiling(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.size != 1
17 arg = Float(arguments[0])
18 rescue TypeError, ArgumentError => _e
19 raise(Puppet::ParseError, "ceiling(): Wrong argument type given (#{arguments[0]} for Numeric)")
22 raise(Puppet::ParseError, "ceiling(): Wrong argument type given (#{arg.class} for Numeric)") if arg.is_a?(Numeric) == false
28 # vim: set ts=2 sw=2 et :