https://github.com/cran/fields
Raw File
Tip revision: e67a1fb4dcdbae26b03d4c4fe859ea995aac2720 authored by Doug Nychka on 12 November 2007, 00:00:00 UTC
version 4.1
Tip revision: e67a1fb
dyadic.check.R
dyadic.check<- function( n,cut.p=2){
# checks that n is of the form 
# n=p*2^m where p <= cut.p
n2<- as.integer(n)
while( n2 > cut.p) {
if(n2%%2!=0 ) {
cat(n, 
"must equal p*2^m where p is less than or equal to ", cut.p
, fill=TRUE)
return(FALSE)
}
n2<- n2/2
}
return(TRUE)
}

  
back to top