Java Reference
In-Depth Information
Calculation
Change format
User
Change base
Figure 6.1 Calculator use cases
are well known and have a coded mathematical foundation. A summary of
these concepts is presented below.
Number bases
Currently in most cultures people learn mathematics using the decimal
base, but several other bases are possible. For instance, computer science
utilizes the binary base.
The number base defines how many different digits can be used to repre-
sent a number. Table 6.2 shows a summary of the most important bases. For
instance, the binary base uses two symbols: “0” and “1”. For the hexadeci-
mal base, since the decimal digits are not sufficient, by convention the
letters of the alphabet are used; so “A” stands for 10, “B” for 11 and so on.
We are considering the positional representation of numbers, i.e. the
value represented by a digit depends not only on the digit itself but also on
its position inside the number.
A positional representation system, whose base is B, is represented as
follows:
c n
...

c 2 c 1 c 0
.

c 1 c 2
...

c m
Table 6.2 Bases and digits
Name
Base
Digits
binary
2
0, 1
decimal
10
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
{"ft_lang_label":"__label__en","ft_lang_prob":0.8346011,"math_prob":0.97914183,"size":1263,"snap":"2020-10-2020-16","text_gpt3_token_len":386,"char_repetition_ratio":0.104845114,"word_repetition_ratio":0.042918455,"special_character_ratio":0.28028503,"punctuation_ratio":0.20338982,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9785439,"pos_list":[0,1,2,3,4,5,6,7,8],"im_url_duplicate_count":[null,1,null,1,null,1,null,1,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-04-10T06:34:45Z\",\"WARC-Record-ID\":\"<urn:uuid:b7f1fe7f-1287-4fb0-9d69-4633ee07a70b>\",\"Content-Length\":\"24348\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:8d31763b-2451-45a1-b971-e8db3efd6fb2>\",\"WARC-Concurrent-To\":\"<urn:uuid:7671fd27-2d91-46c8-9918-6bd16267a75d>\",\"WARC-IP-Address\":\"192.163.238.55\",\"WARC-Target-URI\":\"http://what-when-how.com/Tutorial/topic-1537nv/Software-Development-Case-Studies-in-Java-146.html\",\"WARC-Payload-Digest\":\"sha1:XPR36JRSRYHP2CAYRJ36XO4RP5BEIV7D\",\"WARC-Block-Digest\":\"sha1:SM6QN2Z7MKUADW4RHXRM2CBMY2U5CMKE\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-16/CC-MAIN-2020-16_segments_1585371886991.92_warc_CC-MAIN-20200410043735-20200410074235-00395.warc.gz\"}"}