Home Online Manual
Top
Back: inverse_modulus
Forward: find_index
FastBack:
FastForward:
Up: crypto_lib
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

D.12.2.41 is_prime

Procedure from library crypto.lib (see crypto_lib).

Usage:
is_prime(n)

Return:
1 if n is prime, 0 otherwise

Example:
 
LIB "crypto.lib";
ring r = 0,x,lp;
is_prime(10);
==> 0
is_prime(7);
==> 1