18.10. Non-decimal and compound bases

The following cmavo are discussed in this section:

ju'u

VUhU

to the base

dau

PA

hex digit A = 10

fei

PA

hex digit B = 11

gai

PA

hex digit C = 12

jau

PA

hex digit D = 13

rei

PA

hex digit E = 14

vai

PA

hex digit F = 15

pi'e

PA

compound base point

In normal contexts, Lojban assumes that all numbers are expressed in the decimal (base 10) system. However, other bases are possible, and may be appropriate in particular circumstances.

To specify a number in a particular base, the VUhU operator ju'u is suitable:

Example 18.70. 

lipanopanoju'uredulipano
The-number1010base2equalsthe-number10.

Here, the final pa no is assumed to be base 10, as usual; so is the base specification. (The base may also be changed permanently by a metalinguistic specification; no standard way of doing so has as yet been worked out.)

Lojban has digits for representing bases up to 16, because 16 is a base often used in computer applications. In English, it is customary to use the letters A-F as the base 16 digits equivalent to the numbers ten through fifteen. In Lojban, this ambiguity is avoided:

Example 18.71. 

lidaufeigaiju'upaxadulirezevobi
The-numberABCbase16equalsthe-number2748.

Example 18.72. 

lijaureivaiju'upaxadulicimuxaze
The-numberDEFbase16equalsthe-number3567.

Note the pattern in the cmavo: the diphthongs au, ei, ai are used twice in the same order. The digits for A to D use consonants different from those used in the decimal digit cmavo; E and F unfortunately overlap 2 and 4 – there was simply not enough available cmavo space to make a full differentiation possible. The cmavo are also in alphabetical order.

The base point pi is used in non-decimal bases just as in base 10:

Example 18.73. 

livaipibiju'upaxadulipamupimu
The-numberF.8base16equalsthe-number15.5.

Since ju'u is an operator of selma'o VUhU, it is grammatical to use any operand as the left argument. Semantically, however, it is undefined to use anything but a numeral string on the left. The reason for making ju'u an operator is to allow reference to a base which is not a constant.

There are some numerical values that require a base that varies from digit to digit. For example, times represented in hours, minutes, and seconds have, in effect, three digits: the first is base 24, the second and third are base 60. To express such numbers, the compound base separator pi'e is used:

Example 18.74. 

cipi'ererepi'evono
3:22:40

Each digit sequence separated by instances of pi'e is expressed in decimal notation, but the number as a whole is not decimal and can only be added and subtracted by special rules:

Example 18.75. 

licipi'ererepi'evonosu'ipi'ecipi'ecici
The-number3:22:40plus:3:33
dulicipi'erexapi'epaci
equalsthe-number3:26:13.
3:22:40 + 0:3:33 = 3:26:13

Of course, only context tells you that the first part of the numbers in Example 18.74 and Example 18.75 is hours, the second minutes, and the third seconds.

The same mechanism using pi'e can be used to express numbers which have a base larger than 16. For example, base-20 Mayan mathematics might use digits from no to paso, each separated by pi'e:

Example 18.76. 

lipapi'erepi'eciju'urenodulivovoci
the-number1;2;3base20equalsthe-number443

Carefully note the difference between:

Example 18.77. 

panoju'ureno
the-digit-10base20

which is equal to ten, and:

Example 18.78. 

papi'enoju'ureno
1;0base20

which is equal to twenty.

Both pi and pi'e can be used to express large-base fractions:

Example 18.79. 

lipapi'evopizeju'ureno
The-number1;4.7base20
dulirevopicimu
equalsthe-number24.35

pi'e is also used where the base of each digit is vague, as in the numbering of the examples in this chapter:

Example 18.80. 

deijufrapanopi'epapamoi
This-utteranceis-a-sentence-type-of10;11th-thing.

This is Sentence 10.11.