How many times does the word "and" occur in the letter "civilization"?

Nobody asks - everyone understands where the letters are, and where the words are.
So how much can you mock numbers, constantly confusing the concepts associated with them?

So, how to use the concepts associated with numbers, and how do they differ?

  • one
    In fact, the arithmetic school curriculum says what a number is and what a number is. - Vlad from Moscow
  • one
    @VladfromMoscow, do you suggest sending the questioners to first re-read the school curriculum? - Qwertiy
  • one
    Yes, somehow, until now, I thought that we have compulsory secondary education in our country. Has it been canceled? - Vlad from Moscow
  • four
    @VladfromMoscow: Sometimes it seems to me that yes. - VladD
  • 2
    @alexanderbarakin, but in my opinion, it is the place for him. Terminology still refers to the subject of the site, not meta. - Qwertiy

2 answers 2

Numbers

Number is an abstract unit of measure for quantity.

1 , 2 , 1888 , 712.4 are all numbers.
-7 is also a number. Although in most programming languages ​​there is no literal notation.

A number is a value. It has neither a unit of measure nor a number system. Strictly speaking, one cannot even say that it consists of numbers.

Numbers within a programming language

To what is said above, the data type is added, as well as the possibility of a literal notation.

In memory, the number is represented by a certain set of binary data. No need to say that in this piece of memory are hexes. These are just bytes and bits. A hex dump of a piece of memory is a dump, but not a number.

For example, for C:

  • 10 , 012 , 0xa , 0x0A are different entries of the same number.
  • 10 , 10L , 10.0 are different (albeit equal) numbers, because they have different data types. Of course, they can be considered to be the same, if the value is important for us, not type, but from the point of view of the compiler they are different.

Number systems

The number can be represented as a string in different number systems.
This is still the same number, but the string representations are different.

"1111111111" , "1010" , "14" , "A" are all representations of the number 10 in different number systems (unary, binary, hexadecimal and hexadecimal, respectively).

The phrase "a number in hexadecimal numbering system " is correct, but implicitly implies a " textual representation of a number in hexadecimal numbering system ", i.e., we are talking about a string, not a number.

Numbers

A letter is one character in a word, and
A digit is a single character in the string representation of a number (decimal by default).

A digit can imply both a string ( "5" , "A" ), and a numeric ( 5 , 10 ) variant.
The string variant is the output character, whereas the numeric character should be considered as a remainder in the residue ring.

Arithmetic operations on numbers cannot be performed.
The phrase "add numbers 5 and 7" is incorrect, you can only add numbers.

However, in some cases implicit interpretation of numbers as numbers is possible.

Numbers figures

If the number system is not specified, then decimal is implied.

By numbers, numbers are usually meant the numerical meaning of numbers.
That is, the digits of a number are the set of residues in the residue ring at the base of the number system, which, when scalar multiplied by the corresponding degrees of the number system (already outside the ring), will give the original number. By default, this set is ordered.

In this context, one can speak of arithmetic operations, for example, the " sum of digits of a number " is the sum of the numbers of the above set. Since we are already talking about numbers, the number system no longer plays a role - it was only needed to get a set.

Numbers in string context

A number is any character that belongs to the corresponding category of unicode.
We can assume that it is used to write numbers in natural languages ​​(programming languages ​​do not fit: in writing, 0xA - the symbol A used as a number, but in reality it is a letter). At the same time, I cannot say with an absolute guarantee that any Unicode digit is used in at least one natural language.

PS: In most cases, integers are meant above, but a similar interpretation is possible for fractional ones.

  • one
    Sorry, but for a sober head, even from the third attempt I cannot comprehend this phrase "By numbers, numbers, as a rule, are meant as the numerical meaning of numbers." Is this something from philosophy not for mere mortals? :) - Vlad from Moscow
  • @VladfromMoscow, there I wrote about the two meanings in the paragraph above - numerical and text. For example, there is a number 19191 = 0x4AF7. Under its hexadecimal numerals in most cases the set of numbers {4, 10, 15, 7} will be understood, and not the set of characters {'4', 'A', 'F', '7'} . That is what will allow us to calculate the sum of 4 + 10 + 15 + 7 = 36 , whereas '4' + 'A' + 'F' + '7' does not have a logical sense. - Qwertiy
  • I correctly understood that you decided to write a comic? Personally, I was made laugh by the phrase "Most likely, you can think that it is used to write numbers in natural languages." :) - Vlad from Moscow
  • one
    Thank you, as the Anglo-Saxons say, you made my day! Today I found out that -7 is also a number! Do not tell me when we will begin to study -8? I do not want to miss this lecture! - Vlad from Moscow
  • one
    @VladfromMoscow, for this purpose, the phrase "Although it does not have a literal notation in most programming languages" is there. Javascript - a literal number can be used for a key in an object's literal record: x = { 12: 7 } and y = { 12.3: 7 } - can be, and z = { -12: 7 } - cannot (SyntaxError), because -12 is not a literal. Other languages ​​do the same, only there it is more difficult to demonstrate. - Qwertiy

How not to use the word "numbers":

  • @VladfromMoscow, especially for you, otherwise you believe that everyone knows the school curriculum. - Qwertiy