next up previous contents index
suivant: Graphs monter: Other functions précédent: Numeric evaluation : evalf   Table des matières   Index


Rational approximation : float2rational exact

float2rational (or exact) takes as argument an expression.
float2rational returns a rational approximation of all the floating point numbers r contained in this expression, such that | r - float2rational(r)| < $ \epsilon$, where $ \epsilon$ is defined by epsilon in the cas configuration (Cfg menu, or cas_setup command).
Input :
float2rational(1.5)
Output :
3/2
Input :
float2rational(1.414)
Output :
707/500
Input :
float2rational(0.156381102937*2)
Output :
5144/16447
Input :
float2rational(1.41421356237)
Output :
114243/80782
Input :
float2rational(1.41421356237^2)
Output :
2



giac documentation written by Renée De Graeve and Bernard Parisse