Notebook 08
Number representation
Besides of the concrete names of Julia library functions everything in this chapter is valid for most modern programming languagues and computer systems.
All data in computers are stored as sequences of bits. In Julia, for concrete number types, the bitstring
function returns this information as a sequence of 0
and 1
. The sizeof
function returns the number of bytes in the binary representation.
Integer numbers
Int8
1
1
"00000001"
Positive integer numbers are represented by their representation in the binary system. For negative numbers
typemin
and typemax
return the smallest and largest numbers which can be represented in number type.
-128
127
Unless the possible range of the representation
10
-119
3//10
Floating point numbers
0.30000000000000004
But this should be 0.3. What is happening ???
Decimal representation of
Usually we write real numbers as decimal fractions and cut the representation off if the number of digits is too large or infinite.
Any real number
with base
This representation is infinite for periodic decimal numbers and irrational numbers.