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

bookInteger Division and Remainders

Note
Definition

Integer division calculates how many times one number fits into another, while the remainder shows what is left over.

For example, dividing 16 candies between 3 friends results in 5 candies for each friend and a remainder of 1, since 16 = 5 * 3 + 1.

Arithmetic Operators

In R, these operations are performed using:

  • %/% for integer division;
  • %% for the remainder of a division.

Example

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

Swipe to start coding

  1. Compute how many complete days there are in 435 hours.
  2. Determine how many hours would be left over.

Keep in mind that a day is comprised of 24 hours.

Solución

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 5
single

single

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

Suggested prompts:

Can you explain the difference between `%/%` and `%%` in R?

What other arithmetic operators are available in R?

Can you provide more examples of using these operators?

close

Awesome!

Completion rate improved to 2.27

bookInteger Division and Remainders

Desliza para mostrar el menú

Note
Definition

Integer division calculates how many times one number fits into another, while the remainder shows what is left over.

For example, dividing 16 candies between 3 friends results in 5 candies for each friend and a remainder of 1, since 16 = 5 * 3 + 1.

Arithmetic Operators

In R, these operations are performed using:

  • %/% for integer division;
  • %% for the remainder of a division.

Example

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

Swipe to start coding

  1. Compute how many complete days there are in 435 hours.
  2. Determine how many hours would be left over.

Keep in mind that a day is comprised of 24 hours.

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

close

Awesome!

Completion rate improved to 2.27
Sección 1. Capítulo 5
single

single

some-alt