I was just playing around with C++ when I stumbled across a tutorial on how to multiply very large integers by using strings.
I made a little example http://coliru.stacked-crooked.com/a/a92b251c4593be48 based off of Sergey Zubkov's C++ code and so far everything seems to work great, so why not implement this into GP?
A way to add 'Infinite' Integers?
Moderator: MSandro
Re: A way to add 'Infinite' Integers?
Sounds very nice. But I think the performance would be very low. Working with large integers in GPs current implementatiin isn't performing that good at all.
Re: A way to add 'Infinite' Integers?
as an exercise, i translated the code to GP! (https://www.geeksforgeeks.org/multiply- ... s-strings/)
- Attachments
-
- bigmult.gpp
- (7.04 KiB) Downloaded 671 times
Re: A way to add 'Infinite' Integers?
There was a small error with a small fix that makes the whole thing work perfectly,
just add
when you define the nums2list method
just add
Code: Select all
(letters (toString s))
Re: A way to add 'Infinite' Integers?
it works in its current form but i have to right click on the input boxes so they change from oval (numeric input) to rectangle (string input) before i enter my data. (see image).
however, after i applied your fix, i don't have to think about doing that anymore! thanks!
however, after i applied your fix, i don't have to think about doing that anymore! thanks!
- Attachments
-
- stringonly.JPG (11.92 KiB) Viewed 14307 times