Method on @sym: prevprime (x)

Return the previous prime number.

Example:

prevprime(sym(3))
  ⇒ ans = (sym) 2

prevprime([sym(3) 10 100 1000 65530])
  ⇒ (sym) [2  7  97  997  65521]  (1×5 matrix)

See also: @sym/isprime, @sym/nextprime.

Package: symbolic