ceil() function behavior in postgresql
Description
  The PostgreSQL ceil function returns the smallest integer value that is greater than or equal to a number.


And according Postgres Docs:


  Except where noted, any given form of a function returns the same data type as its argument.


As you can see it works properly, in fact, if you use integers the returned value is one integer (58 * 5) / 100) returns 2 but if you forces it to decimal (58.0 * 5.0) / 100.0 then it returns 2.9.




select 
     (550 * 0.5) / 100 as C1,
     ceil((550 * 0.5) / 100) as CEIL_C1,
     (58 * 5) / 100 as C2,
     ceil((58 * 5) / 100) as CEIL_C2,
     (58.0 * 5.0) / 100.0 as C3,
     ceil((58.0 * 5.0) / 100.0) as CEIL_C3
;



                c1 | ceil_c1 | c2 | ceil_c2 |                 c3 | ceil_c3
-----------------: | ------: | -: | :------ | -----------------: | ------:
2.7500000000000000 |       3 |  2 | 2       | 2.9000000000000000 |       3



dbfiddle here