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




end if;

end for;

Result: f=2



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


f = 2



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

How to print long strings in MAGMA?

Updated March 22, 2019 18:20 PM

Checking types in MAGMA

Updated August 30, 2017 09:20 AM