WIK Posted October 27, 2022 Report Posted October 27, 2022 Salut, are cineva o idee cum pot face o functie in limbajul LUA prin care sa pot face suma a doua numere mari. Ideea e ca numerele vin in format STRING iar output-ul functiei trebuie sa fie tot string (asta-i cea mai mica problema zic eu) dar am intampinat probleme incercand sa execut functii de genu func('95912101285912112391','55101088101994012311') rezultatul este ceva de genu : 5.5101088111585e+019 cum as putea sa fac sa pot face suma a acestor doua numere mari ? Quote
gigiRoman Posted October 28, 2022 Report Posted October 28, 2022 8 hours ago, WIK said: 5.5101088111585e+019 Cred ca e vine de la numarul lui Euler si e o constanta folosita in calcule cu numere foarte mari. 1 Quote
aelius Posted October 28, 2022 Report Posted October 28, 2022 cred ca ai librarie bc disponibila in lua. Uite bc-ul in shell: tex: ~ $ echo 95912101285912112391+55101088101994012311|bc 151013189387906124702 tex: ~ $ echo 9591210128591211224354656789674564325678391^2|bc 91991311730790638549984859641984226694440749371652476503814301826970940359462364348881 edit: te ajuta asta? https://github.com/edubart/lua-bint 1 1 Quote
WIK Posted October 28, 2022 Author Report Posted October 28, 2022 Da ma ajuta cat de cat , imi da o idee cam cum ar face el Quote