ceil

How to ceil, floor and round bcmath numbers?

I need to mimic the exact functionality of the ceil(), floor() and round() functions on bcmath numbers, I've already found a very similar question but unfortunately the answer provided isn't good enough for me since it lacks support for negative numbers and the precision argument for the round() function is missing. I was wondering if a...

Unexpected result using POSIX ceil() in Perl

I can't for the life of me figure out why the following produces the result it does. use POSIX; my $g = 6.65; my $t = $g * 4; my $r = $t - $g; my $n = $r / $g; my $c = ceil($n); print "$c ($n)\n"; Sigil-tastic, I know — sorry. I've solved this for my app as follows: use POSIX; my $g = 6.65; my $t = $g * 4; my $r = $t - $g; my $n = $...

Get ceiling integer from number in linux (BASH)

How would I do something like: ceiling(N/500) N representing a number. But in a linux bash script ...

Round prices up to nearest 5 after conversion in oscommerce

Hi there, A conversion question relating to prices in oscommerce: I am needing for a custom currency conversion to round the USD prices up to the nearest 5$ to avoid prices being displayed at silly prices such as $263. I am trying to convert to an int and round the following line : $curr->display_price($listing['products_price'], te...

getting Ceil() of Decimal in python?

Is there a way to get the ceil of a high precision Decimal in python? >>> import decimal; >>> decimal.Decimal(800000000000000000001)/100000000000000000000 Decimal('8.00000000000000000001') >>> math.ceil(decimal.Decimal(800000000000000000001)/100000000000000000000) 8.0 math rounds the value and returns non precise value ...

Implementation of ceil function in C.

Hi, I have two questions regarding ceil function.. 1. The ceil() function is implemented in C. if i use ceil(3/2), it works fine.. But when i use ceil(count/2)-if value of count is 3, then it gives compile time error.. /tmp/ccA4Yj7p.o(.text+0x364): In function FrontBackSplit': : undefined reference toceil' collect2: ld returned 1 ex...

decimal values in pl/sql

How to display a value as follows in oracle: 99.99 as 99.9900, 99.9 as 99.9000, 9.99 as 9.9900, 99 as 99.0000 All cases should be satisfied.. Please help... ...