Skip to main content

Bitwise Flags

  • Chapter
  • First Online:
Book cover Pro TypeScript
  • 2014 Accesses

Abstract

As described in Chapter 1, you can use an enumeration to define bit flags. Bit flags allow a series of items to be selected or deselected by switching individual bits in a sequence on and off. To ensure that each value in an enumeration relates to a single bit, the numbering must follow the binary sequence whereby each value is a power of two, for example

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 34.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Steve Fenton

About this chapter

Cite this chapter

Fenton, S. (2014). Bitwise Flags. In: Pro TypeScript. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-6790-4_12

Download citation

Publish with us

Policies and ethics