| Author |
Comment/Response |
xavier
|
12/19/12 09:16am
I found one mistake: product had to be termed inside the brackets at the beginning of the Module-segment.
faculty[x_] := Module [{u;product},
product = 1;
u = 1;
While[u <= x,
product = product*u;
u = u + 1
](*While*)
](*Module*)
faculty[3]
Now I get the following output:
Module::lvsym: Local variable specification {u;product} contains u;product, which is not a symbol or an assignment to a symbol. >>
So I think the While-Loop is not the big problem. But I don't understand why Mathematica tells me that u is not a symbol (and product also not). Can anyone help?
Thank you very much!
Xavier
URL: , |
|