Skip to content
ExamplesOpen editor ↗

pow

→ pow()

Raises a number to a power — `pow(2, 3)` is 2 × 2 × 2, which is 8.

pow(palo, maemo)

pow(palo, maemo) multiplies palo by itself maemo times:

  • pow(2, 3) is 8
  • pow(2, -3) is 1 ÷ (2 × 2 × 2), which is 0.125
  • pow(9, 0.5) is 3 — a power of 0.5 is the square root, so this equals sqrt(9)

The name is left as it stands. In the Botswana syllabus powers are called indices, in English, and what is written is the small raised number beside the base. It is notation, not a word — see sq and sqrt.

NameTypeDescription
palopaloThe number being raised.
maemopaloThe power to raise the number to.
Changing the power changes the shape of the growth
tiro setaLoeto() {
  thalaKanefase(400, 400);
  bokamorago(20, 24, 34);
  boketeMothalo(3);

  metlha maemo = [0.5, 1, 2, 3];

  gopheta (diri m = 0; m < 4; m = m + 1) {
    mothaloMmala(70 + m * 55, 200 - m * 30, 240 - m * 40);

    gopheta (diri x = 0; x < 360; x = x + 6) {
      metlha tekanyo = selekanyo(x, 0, 360);
      metlha y = 370 - pow(tekanyo, maemo[m]) * 330;

      thalaNtlha(x + 20, y);
    }
  }
}

sq, sqrt, exp, log