![]() |
|
|
#1783 |
|
Aug 2006
3×1,993 Posts |
|
|
|
|
|
|
#1784 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
Good luck with that lol.
Code:
longmultiply(a,b)= c=eval(Vec(Str(a)));d=eval(Vec(Str(b)));carry=0;answer=[];forstep(x=#d,1,[-1],forstep(y=#c,1,[-1],answer=concat(((c[y]*d[x])+carry)%10,answer);carry=floor((c[y]*d{x])/10))
*** sorry, embedded braces (in parser) is not yet implemented.
didn't work for calculating it before either. Last fiddled with by science_man_88 on 2010-11-29 at 01:52 |
|
|
|
|
|
#1786 |
|
Aug 2006
3·1,993 Posts |
It's already worked. Look at how much you can do with Pari now -- you hadn't even heard of it a year ago.
You wrote "{x]" instead of "[x]". |
|
|
|
|
|
#1787 | |
|
Aug 2006
3×1,993 Posts |
Quote:
You may very well become the #2 Pari contributor on RC if you continue this way. (I don't know who presently has that title, but they couldn't have very many.) |
|
|
|
|
|
|
#1788 | |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
Quote:
Code:
[6, 9, 4, 6] Code:
[7,3,6] Last fiddled with by science_man_88 on 2010-11-29 at 02:25 |
|
|
|
|
|
|
#1789 |
|
Aug 2006
3·1,993 Posts |
Well, good luck debugging. Sometimes splitting the program into multiple functions helps, as does adding diagnostic messages with print(). (You remove these after debugging, of course.)
I finished the Amb task, that was a pain to debug. I hate string processing in Pari.
|
|
|
|
|
|
#1790 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
Really? I thought it was only me that hated it. I'm heading to bed I'm up 30 minutes past when I usually go to bed. I've got Pari still open and I'm semi working on a pascals triangle script.
Last fiddled with by science_man_88 on 2010-11-29 at 02:35 |
|
|
|
|
|
#1791 |
|
Aug 2006
3×1,993 Posts |
The problem I had was related to the power of concat: I wanted it to join together two vectors and it was obligingly smushing them into strings. I managed to solve my problem, thankfully.
|
|
|
|
|
|
#1792 | |
|
"Forget I exist"
Jul 2009
Dumbassville
203008 Posts |
Quote:
023 x32 ___ 0046 +690 not : 23*32 =[6,9,4,6] Last fiddled with by science_man_88 on 2010-11-29 at 13:17 |
|
|
|
|
|
|
#1793 | |
|
Aug 2006
3·1,993 Posts |
Quote:
[0, 0, 0, 0, 0] to [0, 0, 0, 0, 6] to [0, 0, 0, 4, 6] to [0, 0, 0, 13, 6] to [0, 0, 6, 13, 6] which can be simplified to [0, 0, 7, 3, 6] and then [7, 3, 6] if desired. |
|
|
|
|
![]() |
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Why do I sometimes see all the <> formatting commands when I quote or edit? | cheesehead | Forum Feedback | 3 | 2013-05-25 12:56 |
| Passing commands to PARI on Windows | James Heinrich | Software | 2 | 2012-05-13 19:19 |
| Ubiquity commands | Mini-Geek | Aliquot Sequences | 1 | 2009-09-22 19:33 |
| 64-bit Pari? | CRGreathouse | Software | 2 | 2009-03-13 04:22 |
| Are these commands correct? | jasong | Linux | 2 | 2007-10-18 23:40 |