Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Julia

You're reading from   Learning Julia Build high-performance applications for scientific computing

Arrow left icon
Product type Paperback
Published in Nov 2017
Publisher Packt
ISBN-13 9781785883279
Length 316 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Rahul Lakhanpal Rahul Lakhanpal
Author Profile Icon Rahul Lakhanpal
Rahul Lakhanpal
Anshul Joshi Anshul Joshi
Author Profile Icon Anshul Joshi
Anshul Joshi
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Understanding Julia's Ecosystem FREE CHAPTER 2. Programming Concepts with Julia 3. Functions in Julia 4. Understanding Types and Dispatch 5. Working with Control Flow 6. Interoperability and Metaprogramming 7. Numerical and Scientific Computation with Julia 8. Data Visualization and Graphics 9. Connecting with Databases 10. Julia’s Internals

Integers, bits, bytes, and bools


Integers, bits, bytes, bools, and floating point numbers are used in arithmetic operations. Built-in representations of them are called as numeric primitives, and numeric literals are their representations as values in code.

Let’s understand Julia’s primitive numeric types. The following is a table of Integer types, which includes bits, bytes, and bool:

Type

Number of bits

Smallest value

Largest value

Int8

8

-2^7

2^7 - 1

UInt8

8

0

2^8 - 1

Int16

16

-2^15

2^15 - 1

UInt16

16

0

2^16 - 1

Int32

32

-2^31

2^31 - 1

UInt32

32

0

2^32 - 1

Int64

64

-2^63

2^63 - 1

UInt64

64

0

2^64 - 1

Int128

128

-2^127

2^127 - 1

UInt128

128

0

2^128 - 1

Bool

8

false (0)

true (1)

 

The UInt type refers to unsigned integers. These are those integers whose values start from 0.

This table shows the smallest and the largest values that a particular type of integer can hold.

We can also find the smallest and the largest value of a type of integer using the typemin() and typemax() function:

julia> typemax(Int32)
2147483647

julia> typemin(Int32...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime