Java Ceil ceil(int f)

Here you can find the source of ceil(int f)

Description

ceil

License

Artistic License

Declaration

public static int ceil(int f) 

Method Source Code

//package com.java2s;
/*//  w  ww .j av a 2s. com
    
 FP version 3.1
    
 Copyright (c) 2004 Andre de Leiradella <leiradella@bigfoot.com>
    
 This program is licensed under the Artistic License.
    
 See http://www.opensource.org/licenses/artistic-license.html for details.
    
 Uses parts or ideas from FPMath. FPMath is copyright (c) 2001 Beartronics and
 is authored by Henry Minsky.
 http://bearlib.sourceforge.net/
    
 Uses parts or ideas from oMathFP. oMathFP is copyright (c) 2004 Dan Carter.
 http://orbisstudios.com/
    
 */

public class Main {
    public static int ceil(int f) {
        if ((f & 0xFFFF) == 0)
            return f;
        return (f & ~0xFFFF) + (f < 0 ? 0 : 65536);
    }
}

Related

  1. ceil(float x)
  2. ceil(float x)
  3. ceil(float x)
  4. ceil(int a, int b)
  5. ceil(int dividend, int divisor)
  6. ceil(int number, int divisor)
  7. ceil(int x, int quantum)
  8. ceil(long a, long b)
  9. Ceil(Object in, int val)