7

I noticed this code in open zepplins contract:

  uint256 public constant INITIAL_SUPPLY = 10000 * (10 ** uint256(decimals));

I've never seen the double ** before. What does it mean?

  • FYI, the same syntax for exponentiation is used in many programming languages: Python, Ruby, Perl, Fortran, ADA, OCaml, ... – Federico Poloni May 7 '18 at 10:19
13

from the solidity documentation :

Arithmetic operators: +, -, unary -, unary +, *, /, % (remainder), ** (exponentiation)


so : a**b is a to the power of b (i.e: a*a*a*...*a b times)

|improve this answer|||||
5

** is ^. 2 ** 3 equals 8( ´ ▽ ` )

|improve this answer|||||
0

This operator is used for exponentiation.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.