Mathematica 9 is now available
Student Support Forum
Student Support Forum: 'Testing return of function' topicStudent Support Forum > General > Archives > "Testing return of function"

Next Comment >Help | Reply To Topic
Author Comment/Response
06/17/12 2:41pm

I'm using PowerMod to compute inverses mod n. If n isn't prime inverses don't always exist so sometimes the function returns an integer sometimes it doesn't. How can I test in a module if the function is being used on a element that is invertible?

Ie a = PowerMod[2,-1,6] returns an error and when evaluating a I get PowerMod[2,-1,6]. While a = PowerMod[2,-1,5] returns 3.

URL: ,

Subject (listing for 'Testing return of function')
Author Date Posted
Testing return of function Bobby 06/17/12 2:41pm
Re: Testing return of function Bill Simpson 06/18/12 1:24pm
Next Comment >Help | Reply To Topic