I am trying to create a ceiling function in bash that will take a number and round upwards as a ceiling function.
For instance: If shard_div is 3.2 rounded_up will be 4.
rounded_up=`echo $shard_div | awk '{printf("%d\n",$0+=$0<0?0:0.9)}'`
Where the problem is occuring is some shard_div variables are numbers like 0.5^-10 or 0.00001. When this occurs the rounded_up is 0.
I would prefer not to use an if statement, and the machines this is running on do not have Perl.