CryptoZombies | Math Operations

728x90

Math Operations

  • 덧셈: x + y
  • 뺄셈: x - y
  • 곱셈: x * y
  • 나눗셈: x / y
  • 나머지: x % y
  • 지수 연산: x ** y
uint x = 5 ** 2;	// 즉, 5^2 = 25

CryptoZombies 실습

pragma solidity ^0.4.19;

contract ZombieFactory {

    uint dnaDigits = 16;
    uint dnaModulus = 10 ** dnaDigits;
    
}
728x90

'공부 > Solidity' 카테고리의 다른 글

CryptoZombies | Function Declarations  (0) 2024.11.17
CryptoZombies | Arrays  (0) 2024.11.17
CryptoZombies | Structs  (0) 2024.11.17
CryptoZombies | State Variables & Integers  (0) 2024.11.17
CryptoZombies | contract  (0) 2024.11.17