https://github.com/cran/fields
Raw File
Tip revision: 6a574ee78277f7f38ae7939a12894c1616dc61eb authored by Douglas Nychka on 16 October 2015, 01:28:36 UTC
version 8.3-5
Tip revision: 6a574ee
ceiling2.R
# fields, Tools for spatial data
# Copyright 2004-2013, Institute for Mathematics Applied Geosciences
# University Corporation for Atmospheric Research
# Licensed under the GPL -- www.gpl.org/licenses/gpl.html
"ceiling2" <- function(m) {
    if (m < 1) 
        return(NA)
    M <- 1
    while (M < m) {
        M <- M * 2
    }
    M
}
back to top