|
5.1.37 farey
Syntax:
farey ( bigint_expression , bigint_expression )
farey ( ideal_expression , bigint_expression )
farey ( module_expression , bigint_expression )
farey ( matrix_expression , bigint_expression )
farey ( list_expression , bigint_expression )
Type:
- type of the first argument (unless it is
list )
Purpose:
- lift the first argument modulo the second to the rationals.
The (coefficients of the) result a/b is the best approximation under the condition
 farey(list(a,b,..),B) is equivalent to list(farey(a,B),farey(b,B),...) .
Note:
- The current coefficient field must be the rationals.
Example:
| ring r=0,x,dp;
farey(2,32003);
==> 2
|
See
chinrem.
|