Creating a function in MAGMA

by Ragnar1204   Last Updated August 15, 2018 05:20 AM

Recentely, I was created a definite iterative process in Magma like this:

f := 2;

for x,y in {0,1} do

g := x*(2^0)+y*(2^1);

if g eq f then

"f=",f;

"(",x,")";

"(",y,")";

end if;

end for;

Result: f=2

(0)

(1)

My Question Is: Can I create a 1-parameter function using MAGMA language such that evaluate this loop? like:

Function(2);

f = 2

(0)

(1)



Related Questions


Dynamical creation of sets in MAGMA cas

Updated August 21, 2018 06:20 AM

How do I copy an output of magma to a .txt file?

Updated January 23, 2018 16:20 PM


Checking types in MAGMA

Updated August 30, 2017 09:20 AM