카타 7급 Target Date

1 Kotlin[ | ]

2 R[ | ]

dateNbDays <- function (a0, a, p) {
  day_percent = p/100/360
  days = 0
  while( a0<a ) {
    a0 = a0+a0*day_percent
    days = days + 1
  }
  as.character( as.Date("2016-01-01")+days)
}
dateNbDays <- function (a0, a, p) {
  return(as.character((ceiling(log(a/a0,1+p/36000))+as.Date("2016-1-1"))))
}
dateNbDays <- function (a0, a, p) {
  days <- ceiling((log(a) - log(a0))/log(1 + p/36000))
  as.character(as.Date("2016-01-01") + days)
}
dateNbDays <- function (a0, a, p) {
  start <- as.Date("2016-01-01")
  days <- log(a / a0) / log((1 + p / (100 * 360)))
  as.character(start + ceiling(days))
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}