4 #include "base/cl_sysdep.h"
7 #include "float/lfloat/cl_LF.h"
12 #include "cln/lfloat.h"
13 #include "float/lfloat/cl_LF_impl.h"
14 #include "cln/integer.h"
15 #include "integer/cl_I.h"
16 #include "base/digitseq/cl_DS.h"
17 #include "float/cl_F.h"
18 #include "base/cl_N.h"
22 const cl_R cl_I_LF_div (const cl_I& x, const cl_LF& y)
26 // Else convert x to a float and divide.
27 // (If x is shorter than y, we would gain nothing by dividing the absolute
28 // value of x by the mantissa of y, since the numerator of the division would
29 // have to have 2*length(y)+1 words, even if length(x) is much smaller than
31 if (eq(x,0)) { return 0; }
32 var uintC len = TheLfloat(y)->len;
33 return cl_I_to_LF(x,len) / y;
35 // Bit complexity (N = max(length(x),length(y))): O(M(N)).