Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid type in Number_T::is_zero() #35

rwst opened this issue May 3, 2015 · 0 comments


None yet
1 participant
Copy link

commented May 3, 2015

sage: if log(2)*Infinity == Infinity: print "Hello"
type = 45233600
** Hit STUB**: invalid type: is_zero() type not handled

#6  0x00007fffcc873a79 in GiNaC::Number_T::is_zero (this=0x2b54dd0) at numeric.cpp:935
#7  0x00007fffcc879630 in GiNaC::numeric::is_zero (this=0x2b54db0) at numeric.cpp:1964
#8  0x00007fffcc88e113 in GiNaC::relational::operator void (GiNaC::relational::safe_bool_helper::*)() (this=0x2b23630) at relational.cpp:392
#9  0x00007fffcc398acc in relational_to_bool (e=...)

#8  0x00007fffcc88e113 in GiNaC::relational::operator void (GiNaC::relational::safe_bool_helper::*)() (this=0x2b23630) at relational.cpp:392
392                             return make_safe_bool(ex_to<numeric>(df).is_zero());
(gdb) l
387                     const infinity & lh_inf = ex_to<infinity>(lh);
388                     const infinity & rh_inf = ex_to<infinity>(rh);
389                     const ex df = lh_inf.get_direction() - rh_inf.get_direction();
390                     switch (o) {
391                     case equal:
392                             return make_safe_bool(ex_to<numeric>(df).is_zero());

(gdb) p df.dbgprint()
log(2)/abs(log(2)) - 1
$3 = void
(gdb) p lh_inf.dbgprint()
$2 = void

A followup ticket (#36) would be to check positivity of a symbolic factor of infinity in get_direction() in order to get one of -1,0,1 (which as well could be typed and throw an exception if unknown).

Until that ticket is resolved any non-numeric in df should return undecided from relational::safe_bool().

@rwst rwst added the bug label May 3, 2015

@rwst rwst added this to the 0.3.7 milestone May 4, 2015

@rwst rwst closed this in 3ad641b May 4, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.