converting negative double to int return ceil while postivie return floor in java' code example Example: ceil function in java import java.lang.Math; Math.ceil(a);