4 module Puppet::Parser::Functions
5 newfunction(:ceiling, :type => :rvalue, :doc => <<-DOC
7 **Deprecated** Returns the smallest integer greater or equal to the argument.
8 Takes a single numeric value as an argument.
11 **Deprecated** from Puppet 6.0.0, this function has been replaced with a
12 built-in [`ceiling`](https://puppet.com/docs/puppet/latest/function.html#ceiling) function.
14 @return [Integer] The rounded value
18 raise(Puppet::ParseError, "ceiling(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.size != 1
21 arg = Float(arguments[0])
22 rescue TypeError, ArgumentError => _e
23 raise(Puppet::ParseError, "ceiling(): Wrong argument type given (#{arguments[0]} for Numeric)")
26 raise(Puppet::ParseError, "ceiling(): Wrong argument type given (#{arg.class} for Numeric)") if arg.is_a?(Numeric) == false
32 # vim: set ts=2 sw=2 et :