Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Integer Division and Remainders | Basic Syntax and Operations
TEST R COURSE
course content

Conteúdo do Curso

TEST R COURSE

TEST R COURSE

1. Basic Syntax and Operations
2. Vectors

Integer Division and Remainders

Well done! Let's consider the integer division. This kind of division, to be honest, is used almost every day, and you may not notice it.

For example, if you have 16 candies and want to share them among your three friends equally. Then, each friend will receive five candies, and there will be one remaining candy (since 16 = 5*3 + 1). In math, we call that the result of integer division of 16 by 3 is 5, and 1 is the remainder of this division.

In R, you can perform these operations by using:

  • %/% - integer division.
  • %% - the remainder of a division.

The example above can be calculated using R by the following syntax:

1234
# Number of candies for each friend 16 %/% 3 # Number of candies remaining 16 %% 3
copy

The output is:

Tarefa

Using integer division and remainder, complete the following tasks:

  1. Calculate the number of whole days in 435 hours.
  2. Calculate the number of the remaining hours.

Remember, one day consists of 24 hours.

Tarefa

Using integer division and remainder, complete the following tasks:

  1. Calculate the number of whole days in 435 hours.
  2. Calculate the number of the remaining hours.

Remember, one day consists of 24 hours.

Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo

Tudo estava claro?

Seção 1. Capítulo 4
toggle bottom row

Integer Division and Remainders

Well done! Let's consider the integer division. This kind of division, to be honest, is used almost every day, and you may not notice it.

For example, if you have 16 candies and want to share them among your three friends equally. Then, each friend will receive five candies, and there will be one remaining candy (since 16 = 5*3 + 1). In math, we call that the result of integer division of 16 by 3 is 5, and 1 is the remainder of this division.

In R, you can perform these operations by using:

  • %/% - integer division.
  • %% - the remainder of a division.

The example above can be calculated using R by the following syntax:

1234
# Number of candies for each friend 16 %/% 3 # Number of candies remaining 16 %% 3
copy

The output is:

Tarefa

Using integer division and remainder, complete the following tasks:

  1. Calculate the number of whole days in 435 hours.
  2. Calculate the number of the remaining hours.

Remember, one day consists of 24 hours.

Tarefa

Using integer division and remainder, complete the following tasks:

  1. Calculate the number of whole days in 435 hours.
  2. Calculate the number of the remaining hours.

Remember, one day consists of 24 hours.

Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo

Tudo estava claro?

Seção 1. Capítulo 4
toggle bottom row

Integer Division and Remainders

Well done! Let's consider the integer division. This kind of division, to be honest, is used almost every day, and you may not notice it.

For example, if you have 16 candies and want to share them among your three friends equally. Then, each friend will receive five candies, and there will be one remaining candy (since 16 = 5*3 + 1). In math, we call that the result of integer division of 16 by 3 is 5, and 1 is the remainder of this division.

In R, you can perform these operations by using:

  • %/% - integer division.
  • %% - the remainder of a division.

The example above can be calculated using R by the following syntax:

1234
# Number of candies for each friend 16 %/% 3 # Number of candies remaining 16 %% 3
copy

The output is:

Tarefa

Using integer division and remainder, complete the following tasks:

  1. Calculate the number of whole days in 435 hours.
  2. Calculate the number of the remaining hours.

Remember, one day consists of 24 hours.

Tarefa

Using integer division and remainder, complete the following tasks:

  1. Calculate the number of whole days in 435 hours.
  2. Calculate the number of the remaining hours.

Remember, one day consists of 24 hours.

Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo

Tudo estava claro?

Well done! Let's consider the integer division. This kind of division, to be honest, is used almost every day, and you may not notice it.

For example, if you have 16 candies and want to share them among your three friends equally. Then, each friend will receive five candies, and there will be one remaining candy (since 16 = 5*3 + 1). In math, we call that the result of integer division of 16 by 3 is 5, and 1 is the remainder of this division.

In R, you can perform these operations by using:

  • %/% - integer division.
  • %% - the remainder of a division.

The example above can be calculated using R by the following syntax:

1234
# Number of candies for each friend 16 %/% 3 # Number of candies remaining 16 %% 3
copy

The output is:

Tarefa

Using integer division and remainder, complete the following tasks:

  1. Calculate the number of whole days in 435 hours.
  2. Calculate the number of the remaining hours.

Remember, one day consists of 24 hours.

Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Seção 1. Capítulo 4
Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
We're sorry to hear that something went wrong. What happened?
some-alt