Join our
Discord!
LogoLogo
SupraScan ExplorerStarKey WalletDiscord
MoveVM
  • Network
  • Oracles
  • Automation
  • Guides
MoveVM
  • Overview
  • Getting Started
    • Install Supra CLI with Docker
    • Create a Supra Account
    • Create a Move Package
      • Initialize a Package
      • Write a Module
      • Compile and Publish
      • Interact with a Package
    • Create a dApp with StarKey
  • Network Information
  • Token Standards
  • Learn Move 101
    • Getting Started with Move
    • Unsigned Integers in Move
    • Math Operations in Move
    • Using Vectors in Move
    • Reading Resource Data with borrow_global
    • Passing Data in Move: Value vs. Reference
    • Adding Elements with vector::push_back
    • Emitting Events with event::emit
  • Move Book
    • Getting Started
      • Modules and Scripts
      • Move Tutorial
    • Primitive Types
      • Integers
      • Bool
      • Address
      • Vector
      • Signer
      • References
      • Tuples and Unit
    • Basic Concepts
      • Local Variables and Scope
      • Equality
      • Abort and Assert
      • Conditionals
      • While, For, and Loop
      • Functions
      • Structs and Resources
      • Constants
      • Generics
      • Type Abilities
      • Uses and Aliases
      • Friends
      • Packages
      • Package Upgrades
      • Unit Tests
    • Global Storage
      • Structure
      • Operators
    • Reference
      • Standard Library
      • Coding Conventions
  • TypeScript SDK
    • Guides
      • Create Supra Accounts
      • Publish a Package
    • Documentation
    • Repository
  • Rest API
    • Mainnet
      • Accounts
      • Faucet
      • Transactions
      • Block
      • View
      • Consensus
      • Events
      • Tables
    • Testnet
      • Accounts
      • Faucet
      • Transactions
      • Block
      • View
      • Tables
      • Events
  • Developer Resources
    • Supra Dapp Templates
    • Supra Move VS Code Extension
  • Links
    • Supra DevHub
    • SupraScan Block Explorer
    • StarKey Wallet
    • Live Data Feeds
    • Whitepapers
    • Security Audits
    • Supra's Official GitHub
Powered by GitBook
On this page
  • Literals
  • Operations
  • Logical
  • Control Flow
  • Ownership
Edit on GitHub
  1. Move Book
  2. Primitive Types

Bool

bool is Move's primitive type for boolean true and false values.

Literals

Literals for bool are either true or false.

Operations

Logical

bool supports three logical operations:

Syntax
Description
Equivalent Expression

&&

short-circuiting logical and

p && q is equivalent to if (p) q else false

||

short-circuiting logical or

p || q is equivalent to if (p) true else q

!

logical negation

!p is equivalent to if (p) false else true

Control Flow

bool values are used in several of Move's control-flow constructs:

  • if (bool) { ... }

  • while (bool) { .. }

  • assert!(bool, u64)

Ownership

As with the other scalar values built-in to the language, boolean values are implicitly copyable, meaning they can be copied without an explicit instruction such ascopy.

PreviousIntegersNextAddress