-
Notifications
You must be signed in to change notification settings - Fork 0
/
relatorio.txt
73 lines (50 loc) · 1.86 KB
/
relatorio.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
DECIMAL32:
https://en.wikipedia.org/wiki/Decimal32_floating-point_format
usar o Binary integer significand field (BID) e não o DPD
aritimética:
http://speleotrove.com/decimal/daops.html
http://speleotrove.com/decimal/daops.html#refaddsub
//http://krashan.ppa.pl/articles/stringtofloat/
binary128 =
1 bit sinal + 15 bits expoente -> 2 bytes)
112 bits mantissa -> 14 bytes
como cada inteiro tem 2 bytes =>
exponte = 1 inteiro
mantissa = 7 inteiros
conversor binario decimal
https://clevert.com.br/t/pt-br/base-convert
Para operações + - * e / com IEEE:
https://sites.google.com/a/sga.pucminas.br/puc2010-2_a417889/intro-ciencia-computacao/operacoes-ponto-flutuante-ieee754
calculadore IEEE
http://weitz.de/ieee/
Pode ajudar para criar o binary128 em string
http://www.ryanjuckett.com/programming/printing-floating-point-numbers/part-2/
http://kurtstephens.com/files/p372-steele.pdf
Um exemplo maluco de converter para string:
https://stackoverflow.com/questions/59849740/how-can-i-convert-between-a-double-double-and-a-decimal-string
//http://krashan.ppa.pl/articles/stringtofloat/
referencia GNP
http://web.mit.edu/gnu/doc/html/gmp_1.html
http://web.mit.edu/gnu/doc/html/gmp_4.html
exemplo do GNP -> mpz
mpz_t n;
int flag;
/* 1. Initialize the number */
mpz_init(n);
mpz_set_ui(n,0);
/* 2. Parse the input string as a base 10 number */
flag = mpz_set_str(n,"101", 2);
if (flag != 0) {cout << "enrro" << endl;}; /* If flag is not 0 then the operation failed */
/* Print n */
char* x;
x = mpz_get_str(NULL ,10,n);
cout << "n em decimal = " << x << endl;
x = mpz_get_str(NULL,2,n);
cout << "n em binario = " << x << endl;
/* 3. Add one to the number */
mpz_add_ui(n,n,1); /* n = n + 1 */
/* 4. Print the result */
printf (" n +1 = ");
mpz_out_str(stdout,10,n);
printf ("\n");
mpz_clear( n );