Skip to content

Instantly share code, notes, and snippets.

@masaha03
Last active December 28, 2015 15:39
Show Gist options
  • Save masaha03/7523481 to your computer and use it in GitHub Desktop.
Save masaha03/7523481 to your computer and use it in GitHub Desktop.
(n <- 1.4 * 45)
#=> [1] 63
(n <- n %% 6)
#=> [1] 3
as.character(n)
#=> [1] "2.99999999999999"
as.integer(n)
#=> [1] 2
as.integer(round(n))
#=> [1] 3
(n <- 63 %% 6)
#=> [1] 3
as.character(n)
#=> [1] "3"
as.integer(n)
#=> [1] 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment