Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Unevaluated functions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg109350] Re: Unevaluated functions
  • From: mokambo <alexandrepassosalmeida at gmail.com>
  • Date: Fri, 23 Apr 2010 03:47:23 -0400 (EDT)
  • References: <hqou0u$9g5$1@smc.vnet.net> <hqp995$gqv$1@smc.vnet.net>

Thanks Albert and Bob,

To give an example, the multiplicative inverse of 3 computed with

PowerMod[3, -1, 288]

does not evaluate and prints the message:

PowerMod::ninv:3 is not invertible modulo 288

Following your suggestions I tried:

PowerMod[___] := "N/A";

but it does not work unless you unprotect the symbol (a bad idea)

Attributes[PowerMod]
= {Listable, Protected, ReadProtected}

So I searched through the docs and found:

Check[PowerMod[3, -1, 288], "N/A"]

which still prints the error message (can be suppressed with Quiet)
but "returns" N/A as desired :)

Thanks!



  • Prev by Date: Experimental`NumericalFunction::dimsl
  • Next by Date: Re: Adding the elements of a list sequentially
  • Previous by thread: Re: Unevaluated functions
  • Next by thread: Re: Unevaluated functions