These are chat archives for symengine/symengine
I've been testing the eval function which I was writing earlier, and came across the following error:
Consider the following code segment:
basic_const_pi(s); integer_set_ui(t, 1963319607); basic_mul(s, s, t); integer_set_ui(t, 6167950454); basic_sub(r, s, t); //r = pi*1963319607 - 6167950454 // This is equivalent to: 1.497342914414639737573531356935588060199405738165573... × 10^-10
basic_eval(eval2, r, 53, 1); and then
I have tried giving a
RealDouble of value
0.0 directly to
eval, and that gives
I suspect this is because of the internals of multiple precision numbers, but am having a hard time trying to pinpoint where the trouble is happening.
@srajangarg, I don't understand this comment,
but gcd/lcm are done using a modified euclidean algorithm. As the integer ring is not euclidean we cannot implement these yet.
ZZ[t]is not euclidean.
ZZ[t]being Univariate polynomials over integer coefficients?
ZZ[t]is a unique factorization domain (UFD) even if it is not euclidean. It has gcd and lcm, but there is no euclidean algorithm for them.
gcd(a, b) = gcd(b, a*x + b*y)if
gcd(x, b) = 1
ZZ[t]there are two types of prime factors, irreducible polynomials whose integer coefficients have no common factor and then prime numbers.
ZZ[t]there are shortcuts.
QQ[t]and then clear off the denominators.
autokeyword can be used. Do you think I should make the change?
autois that it documents the return types
auto a = UIntPoly::from_dict(..)