Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

invalid type in Number_T::is_zero() #35

Closed
rwst opened this issue May 3, 2015 · 0 comments
Closed

invalid type in Number_T::is_zero() #35

rwst opened this issue May 3, 2015 · 0 comments
Labels
Milestone

Comments

@rwst
Copy link
Member

rwst commented May 3, 2015

http://trac.sagemath.org/ticket/13326

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()
(log(2)/abs(log(2)))*Infinity
$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 as completed in 3ad641b May 4, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant