Roots of unity

Bob McElrath mcelrath at draal.physics.wisc.edu
Sun Jan 20 18:25:01 CET 2002


Richard B. Kreckel [kreckel at zino.physik.uni-mainz.de] wrote:
> The trouble starts already with trivial expressions: If a>0 and b>0, then
> (a+b)>0.  But (a-b) would have to return false, as would (b-a).  This
> makes it already difficult for sums.  Ternary logic would help a bit,
> here.   :-)

You wouldn't need it to be accurate 100% of the time.  Like some other
functions in the library, is_negative should be true if "it can be determined
that..." and false should mean either false or it cannot be determined.

In using this for simplifications and rearrangements, it only means that a
particular simplification wouldn't be applied.

I wonder if "cheating" and using evalf would get you into trouble?  i.e.
    evalf(a-b) < 0

Cheers,
-- Bob

Bob McElrath (rsmcelrath at students.wisc.edu) 
Univ. of Wisconsin at Madison, Department of Physics
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 240 bytes
Desc: not available
Url : http://www.cebix.net/pipermail/ginac-list/attachments/20020120/58f4b829/attachment.pgp


More information about the GiNaC-list mailing list