mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   PARI/GP (https://www.mersenneforum.org/forumdisplay.php?f=155)
-   -   PARI's commands (https://www.mersenneforum.org/showthread.php?t=13636)

science_man_88 2010-12-01 23:59

[QUOTE=3.14159;239550]I'm guessing the last one is C?[/QUOTE]

CRG there's a period breaking the name is that normal ?

3.14159 2010-12-02 00:00

[QUOTE=science_man_88;239554][url]http://rosettacode.org/wiki/Reports:Tasks_not_implemented_in_PARI/GP[/url]

Is what we've been trying to clear Pi.[/QUOTE]

I think PARI/GP's too weak for those tasks.

science_man_88 2010-12-02 00:04

[QUOTE=3.14159;239556]I think PARI/GP's too weak for those tasks.[/QUOTE]

I tried a bunch I've cleared 5 with help and 2 CRG has pretty much rewritten they aren't impossible lol should i point to the ones I've tried ? this would include part of a RLE script,guess number/with feedback ( just saw a message about how long the code is per line I must format it "properly",Pascals triangle, the "Pascals triangle/ puzzle", a lousy rate counter, I've tried loop N + 1/2, and asked about why stack was on the list still and brought up some I think we can finish like the tower of Hanoi ( involves Mersenne numbers for fastest solve).

CRGreathouse 2010-12-02 00:09

[QUOTE=3.14159;239552]And, those numbers would be too large to even handle, let alone make some computations with, and they're not in order from least to greatest.[/QUOTE]

Ding ding! Pi wins.

3.14159 2010-12-02 00:11

[QUOTE=science_man_88;239557]I tried a bunch I've cleared 5 with help and 2 CRG has pretty much rewritten they aren't impossible lol should i point to the ones I've tried ? this would include part of a RLE script,guess number/with feedback ( just saw a message about how long the code is per line I must format it "properly",Pascals triangle, the "Pascals triangle/ puzzle", a lousy rate counter, I've tried loop N + 1/2, and asked about why stack was on the list still and brought up some I think we can finish like the tower of Hanoi ( involves Mersenne numbers for fastest solve).[/QUOTE]

I think that another one that may be partially possible is the challenge of creating a script that would evaluate arithmetic expressions, such as "(5^2 + 7) + 41", without using the built-in calculator.

How the lottery should be;

1. 100 numbers are randomly given to you.
2. Arrange these numbers in a certain order (not given)
3. Winner gets $(10^10).

science_man_88 2010-12-02 00:14

[QUOTE=3.14159;239559]I think that another one that may be partially possible is the challenge of creating a script that would evaluate arithmetic expressions, such as "(5^2 + 7) + 41", without using the built-in calculator.[/QUOTE]

[CODE]evalscript(script) = eval(script)[/CODE] ? or [CODE]evalscript(script) = eval(Vec(Str(script)))[/CODE]

CRGreathouse 2010-12-02 00:15

[QUOTE=3.14159;239553]O rly?[/QUOTE]

[QUOTE=science_man_88;239555]CRG there's a period breaking the name is that normal ?[/QUOTE]

Ah, good for you for noticing!

No, periods aren't allowed in names. What's going on here is that I define pi as a variable, say

[CODE]pi=["Kevin", "3.14159", 42, 0, 0];[/CODE]

then I define the function

[CODE]x.age={
if (type(x) != "t_VEC" || #x != 5, error("Type error"));
x[3]
};[/CODE]

so that pi.age returns pi's age. (Forgive the [i]Hitchhiker's Guide to the Galaxy[/i] reference; I don't know his real age.)

CRGreathouse 2010-12-02 00:19

[QUOTE=3.14159;239559]I think that another one that may be partially possible is the challenge of creating a script that would evaluate arithmetic expressions, such as "(5^2 + 7) + 41", without using the built-in calculator.[/QUOTE]

[QUOTE=science_man_88;239560][CODE]evalscript(script) = eval(script)[/CODE] ? or [CODE]evalscript(script) = eval(Vec(Str(script)))[/CODE][/QUOTE]

Not allowed, see the problem description.

3.14159 2010-12-02 00:19

[QUOTE=CRGreathouse;239561]Ah, good for you for noticing!

No, periods aren't allowed in names. What's going on here is that I define pi as a variable, say

[CODE]pi=["Kevin", "3.14159", 42, 0, 0];[/CODE]

then I define the function

[CODE]x.age={
if (type(x) != "t_VEC" || #x != 5, error("Type error"));
x[3]
};[/CODE]

so that pi.age returns pi's age. (Forgive the [i]Hitchhiker's Guide to the Galaxy[/i] reference; I don't know his real age.)[/QUOTE]

I'm 42 * 0.380952380952380952380952381...

CRGreathouse 2010-12-02 00:23

[QUOTE=3.14159;239565]I'm 42 * 0.380952380952380952380952381...[/QUOTE]

Wow, that's a lot of decimal places. Can we assume you were born at 7:19:00.00000000000000000006 PM, then? :razz:


Actually I learned something from my pi.age example: I had thought that member functions (somehow) returned lvalues, but it looks like they just give ordinary rvalues. As a result you can't actually do pi.age++.

science_man_88 2010-12-02 00:24

you know how you can load the file on runtime with the functions ?

can you do the same but call a function on runtime ? if so

Create a two-dimensional array at runtime is doable with that just make a useless function that creates the array.


All times are UTC. The time now is 23:09.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.