News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

how can I create floating point?

Started by mineiro, January 13, 2020, 11:29:24 AM

Previous topic - Next topic

mineiro

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, ...
I'd rather be this ambulant metamorphosis than to have that old opinion about everything

aw27

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
2) A known factorization method is based in continued fractions.
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 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.

avcaballero

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 with this, the 6.3.4. point (the last one)

mineiro

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.
I'd rather be this ambulant metamorphosis than to have that old opinion about everything

daydreamer

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
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

mineiro

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.
I'd rather be this ambulant metamorphosis than to have that old opinion about everything

FORTRANS

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.