The MASM Forum

General => The Campus => Topic started by: mineiro on January 13, 2020, 11:29:24 AM

Title: how can I create floating point?
Post by: mineiro on January 13, 2020, 11:29:24 AM
How can I create a floating point from a binary point of view? I'm talking in intergers point of view.
I have tried a lot, but some numbers needs more bits while others not. Why?
Why I cant represent all fractions into this sense?
I was reading some documents from doctors and academic, but this does not enter into my mind.
To be easy, how much is 1/??
Title: Re: how can I create floating point?
Post by: HSE on January 13, 2020, 12:03:36 PM
Mineiro:

¿what is a point of view?

You want to represent fraccions with integers. ¿Are You well?  :biggrin:
Title: Re: how can I create floating point?
Post by: jimg on January 13, 2020, 12:19:28 PM
Can you write 1/3 exactly as a decimal?   No, it is 1.333333333.....

Similarly, binary cannot represent all fractions.
Title: Re: how can I create floating point?
Post by: mineiro on January 13, 2020, 12:21:46 PM
I'm fine sir HSE. I like to reproduce my question.
How much bits I need to represent a reason, division?
As an example: the number 4,5,6,7 in binary have 3 bits only. If i try 1/4,1/5, ... how many bits I need to represent that division? Why is not 3 bits plus one? Why some divisions need more than N bits?
This sounds easy in decimal, but lets take pi=3.1415. If pi ends like that instead of infinite, I know that I just need translate that decimal to binary which I know how to do, but how to reach exactly instead of aproaching number?
Title: Re: how can I create floating point?
Post by: mineiro on January 13, 2020, 12:43:16 PM
Quote from: jimg on January 13, 2020, 12:19:28 PM
Can you write 1/3 exactly as a decimal?   No, it is 1.333333333.....

Similarly, binary cannot represent all fractions.
Yes, 0.333... something like this. But how many numbers 3 is necessary? I know is infinite, but to precision of 1/3 we dont need too much because number 3 fits in 2 bits.
Title: Re: how can I create floating point?
Post by: HSE on January 13, 2020, 01:00:30 PM
Quote from: mineiro on January 13, 2020, 12:21:46 PM
I'm fine sir HSE.
Fantastic  :thumbsup:

If you are creating a system of representation the rules are what you want.
If you define that those bits means "inverse" 1/7 requiere 3 bits, but you can't represent 1/8.
Title: Re: how can I create floating point?
Post by: jj2007 on January 13, 2020, 04:58:02 PM
Quote from: mineiro on January 13, 2020, 12:21:46 PMIf i try 1/4,1/5, ... how many bits I need to represent that division? Why is not 3 bits plus one?

You can represent a division like 3/7 with 8 bits:
include \masm32\include\masm32rt.inc
.code
ThreeBySeven db 7*16+3
SevenByThree db 3*16+7
start:
  movzx eax, ThreeBySeven
  mov edx, eax
  and eax, 7
  sar edx, 4
  push eax
  fild dword ptr [esp]
  push edx
  fild dword ptr [esp]
  fdiv
  fstp REAL8 ptr [esp]
  invoke crt_printf, chr$("3/7=%0.18f", 13, 10), REAL8 ptr [esp]

  movzx eax, SevenByThree
  mov edx, eax
  and eax, 7
  sar edx, 4
  push eax
  fild dword ptr [esp]
  push edx
  fild dword ptr [esp]
  fdiv
  fstp REAL8 ptr [esp]
  invoke crt_printf, chr$("7/3=%0.18f", 13, 10), REAL8 ptr [esp]
  inkey
  exit
end start


The possible range is 1/7 ... 7/1. If you allow 16 bits, you can even use negative numbers, as in -66/77 - see attached source:
3/7=    0.428571283684245130
7/3=    7.000000955304130900
-66/77= -0.86842095837193090
Title: Re: how can I create floating point?
Post by: mineiro on January 13, 2020, 06:09:06 PM
The number 4 and 5 in binary is 100 and 101, so they have a size of 3 bits.

1/4 = 0.25
1/5 = 0.2

transforming that decimal floating point to binary floating point.
1/4 = 0.25   ==>   0.5   1.0   ==>0.01
1/5 = 0.2   ==>   0.4   0.8   1.6   1.2   0.4   ...   ==>0.00110011...

1/4 need 2 binary digits in fractional part to be represented and result reach remainder zero, or end.
1/5 need 4 binary digits in fractional part to be represented until it continues repeating and result never reach remainder zero.

The question is: Why? Why 1/4 give as result 2 bits and 1/5 give as result 4 bits.
How can I know how many binary digits is necessary to represent a fraction until result is zero or a periodic tithe?
Why 1/4 fits in itself and 1/5 do not fit in itself?

So, if I have in decimal the fraction 100/123, how many binary digits is necessary to represent that fraction?

------while I was writing you posted sir jj2007. But without using floating point instructions, only interger instructions, well, interger math.
Quote from: jj2007 on January 13, 2020, 04:58:02 PM
You can represent a division like 3/7 with 8 bits:
Yes, but why you know that the result fit in 8 bits? Whats the minimum size?
Thanks.
Title: Re: how can I create floating point?
Post by: jj2007 on January 13, 2020, 06:32:43 PM
Quote from: mineiro on January 13, 2020, 06:09:06 PM
Whats the minimum size?

It's different for any number. Try using this in my example, and put an int 3 between fdiv and fstp. Then check the number in ST(0).

HundredBy123   dw 100+123*256
Title: Re: how can I create floating point?
Post by: mineiro on January 13, 2020, 07:48:23 PM
Thank you for your patience but I continue without understanding.

How much bits I need to represent 1/N, where N is a interger random number with sizeof 3 bits?
So can be 1/1, 1/2, 1/3, 1/4, 1/5, 1/6, 1/7.

Minimum size is 1 bit, because 1/1 = 1. So, how many bits is necessary to hold the result of that division where N is random?
Title: Re: how can I create floating point?
Post by: jj2007 on January 13, 2020, 08:12:51 PM
See below. What is the practical application of your question?

1 1/1
2 1/2
2 1/3
3 1/4
3 1/5
3 1/6
3 1/7
4 1/8
4 1/9
4 1/10
4 1/11
4 1/12
4 1/13
4 1/14
4 1/15
Title: Re: how can I create floating point?
Post by: mineiro on January 13, 2020, 09:21:55 PM
I'm not able to represent that as 1/4 as an example, I need represent that as binary floating point number. That's why I talked about pi.
Not all numbers that I'm dealing are just 1/N, they can be X/Y (really huge numbers), so using pi as example, I can have 3 as interger part and that infinite as remainder.
Well, ok, inverting scenario, whats 1/pi? Assume that pi = 3,1415. How many binary digits is necessary to represent this arithmetic?

The pratical application of this is to me conquer the world.
Again, thank you.
Title: Re: how can I create floating point?
Post by: jj2007 on January 13, 2020, 09:52:01 PM
1/PI=0.31830988618379067153776752674503... and you need an infinite number of bits to represent that number.
Title: Re: how can I create floating point?
Post by: JonasS on January 13, 2020, 09:57:06 PM
PI is not a good example, it is not an algebraic number, can not be put in fractional form.
Title: Re: how can I create floating point?
Post by: jj2007 on January 13, 2020, 10:58:05 PM
Right, Jonas. But 3/7 is a good example, and it can be exactly "represented" with 8 bits=1 byte, as shown above. The problem is what to do with the result... using the FPU with max 19 digits of precision?
Title: Re: how can I create floating point?
Post by: mineiro on January 13, 2020, 11:15:42 PM
Yes, I know, pi is transcendental, we will never reach pi, we just approach pi. So I truncated the number, see it as pseudo_pi or another constant like plank, gravity, .... I suppose only pi and euler is transcedental.
jj2007, I used your example to clarify what I want. You said 3/7 can be represented exactly with 8 bits. See that we can represent it as 0. and then 3 repetitive bits. That can give, can be represented with less than 8 bits.

3/7 =
0,42857142857142857142857142857143
0,85714285714285714285714285714286
1,7142857142857142857142857142857
1,4285714285714285714285714285714
0,85714285714285714285714285714286
1,7142857142857142857142857142857

3/7=0.011011...

---edited---
I forgot to say, thank you sir JonasS; thank you sir jj2007.
Title: Re: how can I create floating point?
Post by: daydreamer on January 15, 2020, 01:10:59 AM
Quote from: mineiro on January 13, 2020, 11:15:42 PM
Yes, I know, pi is transcendental, we will never reach pi, we just approach pi. So I truncated the number, see it as pseudo_pi or another constant like plank, gravity, .... I suppose only pi and euler is transcedental.
jj2007, I used your example to clarify what I want. You said 3/7 can be represented exactly with 8 bits. See that we can represent it as 0. and then 3 repetitive bits. That can give, can be represented with less than 8 bits.

3/7 =
0,42857142857142857142857142857143
0,85714285714285714285714285714286
1,7142857142857142857142857142857
1,4285714285714285714285714285714
0,85714285714285714285714285714286
1,7142857142857142857142857142857

3/7=0.011011...

---edited---
I forgot to say, thank you sir JonasS; thank you sir jj2007.
dont forgot sqrt(2) is endless decimals too
RCPSS sse instruction performs 1/x for you with 1024 bit lut
Title: Re: how can I create floating point?
Post by: dedndave on January 15, 2020, 02:43:03 AM
in the "real world", you rarely need more digits than can be represented with 80 bit reals

the problem often lies with entering a value as decimal digits, converting it to binary real, then back to decimal
add a little OCD (common with programmers), and you have an issue

if you really want to maintain the original decimal digits for fractions, you may want to consider storing it in the form
of two reals, numerator and denominator

another approach might be to use an 80 bit real, but round off some of the displayed digits

i sometimes want to store large values with precise digits, such as time or frequency values
manipulation speed is not always that critical
there are other formats that may be better suited, such as BCD, or even the original ASCII strings
Title: Re: how can I create floating point?
Post by: jj2007 on January 15, 2020, 03:16:19 AM
Quote from: dedndave on January 15, 2020, 02:43:03 AMif you really want to maintain the original decimal digits for fractions, you may want to consider storing it in the form
of two reals, numerator and denominator

Or as integers:
FourteenBy15 db 14+15*16
FifteenBy14 db 15+14*16

14/15           0.933333039151814980
as REAL10:      0.9333333333333333482
15/14           1.071428537152574500
as REAL10:      1.0714285714285714


The representation is exact, the visualisation cannot be exact. And the range is 1/15...15/1 for a one-byte format.
Title: Re: how can I create floating point?
Post by: nidud on January 15, 2020, 03:55:30 AM
deleted
Title: Re: how can I create floating point?
Post by: mineiro on January 15, 2020, 03:59:18 AM
Oh yeah, square root of 2 is a 1by1 square and we take the diagonal. I prefer romantic era instead of modern era.

Do you know any way to know how many bits are needed to store the result? Which takes up less space on the device, numerator and denominator or just the result of splitting?
In the previous example, if I were to store the numerator 3 (2 bits) and the denominator 7 (3 bits) this would give 5 bits the gross mode. The result showed me with the hidden 0. that fits in the smallest space. I am currently treating infinity as a supposed infinite series of ones, updated after each operation.
Can I assume that the biggest number (numerator or denominator) holds the space to store the division result? If no, why?

It would be something like factorials, I know there is a very crazy formula that I little understood about how many digits are needed for the result of a factorial, without having to calculate the factorial itself.
But I want to know about divisions.

I appreciate your answers gentlemen daydreamer,dedndave, jj2007 and nidud. Thanks.
Title: Re: how can I create floating point?
Post by: nidud on January 15, 2020, 04:17:52 AM
deleted
Title: Re: how can I create floating point?
Post by: HSE on January 15, 2020, 05:00:53 AM
Quote from: mineiro on January 15, 2020, 03:59:18 AM
I appreciate your answers gentlemen daydreamer,dedndave, jj2007 and nidud. Thanks.
Hey...  not me!!

:biggrin: You are wright.
Title: Re: how can I create floating point?
Post by: hutch-- on January 15, 2020, 06:47:12 AM
There is a solution, stop using base 10 and use a flexible base number system like the old fashioned fraction we did at school long ago.

A fraction like 3/7 is perfectly precise if you use a base 7 number system. Using a decimal system is more than adequate in most instances as a fraction like 3/7 to even 8 decimal places easily exceeds the precision required for ordinary tasks. There are of course calculations that require far higher precision but in ordinary circumstances, high decimal point counts are of little use..
Title: Re: how can I create floating point?
Post by: mineiro on January 15, 2020, 07:35:36 AM
sorry sir HSE, I forgot you. Thank you too. A beer to you.

sir hutch, I was looking to other bases, like 60, 20, 5, ... . Pythagoras suggested that best base was 10, like a harmony base, to music that changes to octaves, but to minimal losses I suppose the better was base 2. Entropy formula by Shannon is calculated using log2. I also think in unary base.
Well, If i can calculate the factor of both numbers I can calculate the better base.
Title: Re: how can I create floating point?
Post by: jj2007 on January 15, 2020, 08:08:43 AM
include \masm32\include\masm32rt.inc
include division.inc   ; see attachment
.code
Division FourteenBy15=14/15
Division FifteenBy14=15/14
Division negative=-66/77
Division Pi=22/7
Division HundredBy123=100/123
start:
  PushDiv FourteenBy15
  fstp REAL8 ptr [esp]
  invoke crt_printf, cfm$("14/15\t\t%0.18f\nas REAL10:      0.9333333333333333482", 13, 10), REAL8 ptr [esp]

  PushDiv FifteenBy14
  fstp REAL8 ptr [esp]
  invoke crt_printf, cfm$("15/14\t\t%0.18f\nas REAL10:      1.0714285714285714", 13, 10, 10), REAL8 ptr [esp]

  PushDiv negative
  fstp REAL8 ptr [esp]
  invoke crt_printf, cfm$("-66/77   \t%0.17f", 13, 10), REAL8 ptr [esp]

  PushDiv HundredBy123
  fstp REAL8 ptr [esp]
  invoke crt_printf, cfm$("100/123  \t%0.17f", 13, 10), REAL8 ptr [esp]

  PushDiv Pi
  fstp REAL8 ptr [esp]
  invoke crt_printf, cfm$("Pi as 22/7\t%0.17f", 13, 10), REAL8 ptr [esp]
  inkey chr$(0)
  exit
end start
Title: Re: how can I create floating point?
Post by: mineiro on January 15, 2020, 10:40:13 AM
Sir hutch, sorry to post an image in your server, I know that spends a lot of bandwidth, but without this image this will be hard to explain. Well, I suppose can be usefull to your eletrical deals.

I am tired, after a long journey of study I see only disappointments. I will reveal the secret behind this topic. The best I can do is keep weeding and growing food.
Public domain.

I could feel arithmetic compression but couldn't explain it. I tried mental regressions but in vain. Take your beer, your cigarette, sit down comfortably.

PART 1: PHYSICS, ELECTRICITY
I find it strange that the electron charge is 1.6. Being Catholic and believing in the golden or divine number, I wondered if there was any relationship between the electron charge and Fibonacci. And here came the crack.

In electrical we study circuits with resistors in series, parallel and mixed. I think it is Thevenin who said that every resistive circuit can be shortened with only one voltage source (voltage) and only one resistor called the equivalent resistance.
No matter how many resistors I have in a circuit, no matter if they are in series and parallel, it just matters that we can represent the entire circuit with only 1 resistor.
The formula used is: Voltage = Resistance * Amps
If the resistance is equal to 1ohm, then the voltage is equal to the intensity of the electric current (amps).


PART 2: FIBONACCI
The fibonacci sequence is known to everyone:
1,1,2,3,5,8,13,21,34,55,89, ....
If we take two sequential numbers and divide them we tend to find the golden number.
55/34 = 1.6176470588235294117647058823529
89/55 = 1.618181818181818181818181818181818
But something curious happens when we reverse the division, see:
34/55 = 0.61818181818181818181818181818182

Did you notice that the ratio between 89/55 and 34/55 is the same? Same floating points except for one detail: One starts with 0 and the other with 1 for the entire part.
Joining mixed electrical circuits with fibonacci. If all resistors are 1 ohm, strangely I can fit fibonacci into the electrical circuit.


PART 3: ARITHMETIC DATA COMPRESSION - fibonacci compression or sunflower compression.
Joining the useful with the pleasant. If we think of equivalent resistance as a form of data compression and the electrical circuit (resistors) as an abstract representation of the fibonacci sequence then it can be done. But in digital circuits we deal with the binary base. Then I should combine the 3 themes into one. Mathematicians do not compress data, mathematicians model data.

Imagine the following electrical circuit of figure 3:
we have arranged the resistors: 3,4,2,3,1
Series = numerator, parallel = denominator
Series = 1, parallel = 0

34231
Converting the circuit to binary:
1110000110001
Starting from right to left we do:
1/3
3 * 2 + 1 = 7/3
7 * 4 + 3 = 7/31
31 * 3 + 7 = 100/31

The equivalent pseudo resistance or the compressed circuit or the compressed binary digits can be represented by the division 100/31 = 3,2258064516129032258064516129032
Note that the nonzero integer (the number 3) corresponds to the circuit starting with ones instead of zeros (starting in series), and changing to 0 (parallel), then to 1, to 0, to 1, .. .

As seen in fibonacci, the data are sequences of parallels and series, or series and parallels, or if viewed in binary, a sequence of 01010101 ... or 10101010 ...

How will we have the digits again only with 3,2258064516129032258064516129032? Through inversion and subtraction of whole parts:
We already know that the circuit has 3 equal elements repeated and that starts with one's, let's subtract the whole part 3 and continue:
3.2258064516129032258064516129032 - 3 = 0.22580645161290322580645161290323
Now we invert the result:
1 / 0.22580645161290322580645161290323 = 4.4285714285714285714285714285714
subtract the whole part 4 and invert
1 / 0.42857142857142857142857142857143 = 2.3333333333333333333333333333333
subtract the whole part 2 and invert
1 / 0.33333333333333333333333333333333 = 3
and here we reach the end. If you wonder why we didn't get to resistor 1 or the first resistor was because I started the sequence from 1 and not 2 which would be the proper fibonacci number to be the initial one. I mean, I didn't do the math operation for the first resistor, just from the second resistor.

Reducing equivalent resistance at its lowest lossless representation? This was the question I raised in this topic.
3,2258064516129032258064516129032
trying by brute force the operations have to 3.2258 can represent the lossless circuit (i'm ignoring the 1st ohm resistor).
3.2258 in binary equals 11.001110011100111000000 ... in single words 11.00111 (times 3)

Well, if I enter as information that the circuit starts in series or parallel, just one bit, then I can reverse the number 3,2258 and get:
1 / 3.2258 = 0.31000062000124000248000496000992
Now the number is more palatable and compact: 0.31 is the number representing that electrical circuit, or the sequence 34231
Continue inverting and subtracting the entire part and you will see:
1 / 0.31 = 3.2258064516129032258064516129032
1 / 0.22580645161290322580645161290323 = 4.428571428
...
Title: Re: how can I create floating point?
Post by: Mikl__ on January 15, 2020, 10:53:52 AM
Hi mineiro!
Binary fractions (http://masm32.com/board/index.php?topic=8196.0)
Title: Re: how can I create floating point?
Post by: mineiro on January 15, 2020, 11:04:21 AM
thank you sir Mikl__

Time to members here that need some money to run into the gold.
http://prize.hutter1.net/
Title: Re: how can I create floating point?
Post by: jj2007 on January 15, 2020, 11:31:03 AM
Quote from: mineiro on January 15, 2020, 10:40:13 AM89/55 = 1.618181818181818181818181818181818
But something curious happens when we reverse the division, see:
34/55 = 0.61818181818181818181818181818182

Did you notice that the ratio between 89/55 and 34/55 is the same? Same floating points except for one detail: One starts with 0 and the other with 1 for the entire part.

Not so surprising: 89/55=34/55+55/55=0.618+1=1.618
Title: Re: how can I create floating point?
Post by: mineiro on January 15, 2020, 01:07:36 PM
1 1 2 3 5 8 13 21 34 55
55=34+21
1+1+2+3+5+8+13+21+34==89-1

Yes, that's why I separated in serial and parallel. Serial representing interger part (numerator), parallel representing fractionary part (denominator).

This gets interesting if we forgot data compression and apply to other things:
Can you represent a constant, suppose euler, gravity, pi in electrical circuit (mixed)?
≈ 3.14159 26535 89793 23846 ..., but I'm stopping here.
pi starts with 3 as interger part, so we have 3 resistors in serial way, the next one will be in parallel
1/0,14159265358979323846 == 7,0625133059310457699248547161662
so we have 7 resistors in parallel,
1/0,06251330593104576992485471616621 = 15,996594406685719855183939426821
now we have 15 resistors in serial way
1/0,9965944066857198551839394268208 = 1,0034172310133726374342508818607
now we have 1 resistor in parallel
1/0,00341723101337263743425088186067=292,63459101439256334858172125453
now we have 292 resistors in serial way, ...
Title: Re: how can I create floating point?
Post by: aw27 on January 16, 2020, 02:21:55 AM
Quote
How many binary digits is necessary to represent this arithmetic?

Mineiro,
If you ever discover that, if you find the general formula for that the World will never be the same.
The reason is simple (try to follow me):
1) All fraction have a period. A period is this (http://mathworld.wolfram.com/DecimalPeriod.html)
2) A known factorization method is based in continued fractions (https://en.wikipedia.org/wiki/Continued_fraction).
When a period is found we have found the factors of a number.
3) Most secure transaction are based in RSA, which relies in the extreme difficulty to factorize big numbers, namely those that are a product of 2 big prime numbers.
4) The Continued fraction factorization method (https://en.wikipedia.org/wiki/Continued_fraction_factorization) can factorize numbers like those used in RSA, the problem is that the period is not only unknown to start with but may be in the order of trillions of trillions (or more) decimals. One think is sure, all rational fractions have a period. Soon or later the sequence will start repeating.
Title: Re: how can I create floating point?
Post by: avcaballero on January 16, 2020, 03:00:26 AM
I have read some comments, I don't know if it is exactly what is being talked about. I think we avoid imaginary numbers and we get only rational ones, which can be represented as two integers a, b in the form (a/b). So here it depends on the range you want to give to the dimension of these integers, byte, word, dword, the rational number would be twice the size since it encompasses two.

The key is to understand that a/b is the best representation of a rational number, for example:

1/3 = 0,3333333333333333 (0 comma 3 period)

1/3 is the best way to represent it, and this is a number, not two.

If we have defined our structure

typedef struct tagRational {
   int a; // 4 bytes
   int b; // 4 bytes
} stRacional;

miRacional stRacional; // 8 bytes

And, from here, define the mathematical operations on this structure. I made some years ago a program (http://abreojosensamblador.epizy.com/?Tarea=1&SubTarea=6#Ejercicios) with this, the 6.3.4. point (the last one)
Title: Re: how can I create floating point?
Post by: mineiro on January 16, 2020, 06:28:54 AM
I'm digesting your comments.
Last night I was reading Mikl__ binary fractions link. I read 3 times, but today I read that again. I'm slow in understanding things. I prefer understand instead of apply things. So, from that link I was deducing "correction factor" used in floating point.
From caballero I need create a structure, wich dedndave told before, store numerator and denominator.
From AW that continued fraction is what I was trying without know that have that name. I have see cited in article Gauss and Euclid. I remember some movies seen from Gauss, prodigy children. I'm focus in this link now, because by my own intuition all that is said in that text is the path that I have walked, even without knowledge. I know that you told about criptograph, and choose prime numbers, and a cripto result is entropically hard to compress, ... .

Thank you sir's, really apreciated.
Title: Re: how can I create floating point?
Post by: daydreamer on January 17, 2020, 11:54:23 PM
sometimes images make you better understand,numbers,graph plots and image that shows where prime numbers are compared to composites(name for the non-primes)
sunflower seeds are placed with one prime number in one direction,the other direction is the next prime number
Gaussian lens teacher showed us in school,its flat lens in projector where you place lying transparent A4's with written info in different colors
Title: Re: how can I create floating point?
Post by: mineiro on January 18, 2020, 09:37:32 AM
hello sir daydreamer;
yes, sometimes I need see to believe. Prime numbers I see as lines, while non prime numbers are squares or rectangles created by lines. From this, I can't understand why number 1 is not a prime number, but I accept that it's not a prime number.
What has been hidden is what has been hidden. Hmm, this does not have the same sense as in my mother language: "o que foi escondido é o que se escondeu".
I still haven't found an example on the internet about fibonacci in electrical circuits, and that's motivated me. I was thinking that I have found something new. But now I can conclude just a new way of doing nothing new :(
A4 paper also follows a proportion (A2,A1,A3,...); I find it strange how flat lenses are seen through round eyes.
thanks.
Title: Re: how can I create floating point?
Post by: FORTRANS on January 20, 2020, 12:17:09 AM
Hi,

Quote from: mineiro on January 18, 2020, 09:37:32 AM
From this, I can't understand why number 1 is not a prime number, but I accept that it's not a prime number.

   A few reasons.  One is factoring composite numbers.
If one is a prime, then factoring a composite number
into its prime factors is no longer unique.  As you could
have any number of ones as members of its prime
factors.

Cheers,

Steve N.