Fandom

Petit Computer Wiki

% (Operator)

915pages on
this wiki
Add New Page
Comments3 Share

% is the BASIC operator for modulo arithmetic. A%B gives the remainder after A has been divided by B.

Unlike some implementations of BASIC, B may be a noninteger. Also, B may be negative, but the result given is the same as if it were positive. Of course, B must be nonzero, otherwise the system will generate an error: Division by zero.

If A is positive, the result is positive (or zero), and if A is negative, the result is negative (or zero).

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.