You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
villares edited this page May 24, 2020
·
4 revisions
Nome
% (módulo ou resto)
Exemplos
int a =20%100; // Atribui 20 à aint b =20%100; // Atribui 20 à bfloat c =75.0%100.0; // Atribui 75.0 à cfloat d =275.0%100.0; // Atribui 75.0 à d
float a =0.0;
voiddraw() {
background(204);
a = (a +0.5)%width;
line(a, 0, a, height);
}
Descrição
Clacula o resto de uma divisão de um
número por outro. É extremamente útil para
manter números dentro de um limite, como no caso de manter uma
forma na tela.