Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Integer Division and Remainders | Section
Practice
Projects
Quizzes & Challenges
Quizer
Challenges
/
Essential R Programming for Absolute Beginners - 1768563985826

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
Oppgave

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.

Løsning

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 5
single

single

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

close

bookInteger Division and Remainders

Sveip for å vise menyen

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
Oppgave

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.

Løsning

Switch to desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 5
single

single

some-alt