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

display of relational operators #24

Closed
andrejv opened this issue Apr 20, 2011 · 1 comment
Closed

display of relational operators #24

andrejv opened this issue Apr 20, 2011 · 1 comment

Comments

@andrejv
Copy link
Collaborator

andrejv commented Apr 20, 2011

Converted from SourceForge issue 1303877, submitted by willisbl

Consider

(defun $compare (a b)
(let ((sgn))
(cond
((or (not ($featurep a '$real)) (not ($featurep
b '$real))) '$notcomparable)
((eq (setq sgn (csign ($limit ($ratsimp (sub a
b))))) '$neg) 'mlessp)
((eq sgn '$nz) 'mleqp)
((eq sgn '$zero) 'mequal)
((eq sgn '$pz) 'mgeqp)
((eq sgn '$pos) 'mgreaterp)
((eq sgn '$pnz) '$unknown)
(t '$unknown))))

With xmaxima:

(%i8) compare(5,6);
(%o8) "<"
(%i9) compare(x,x+abs(x));
(%o9) "<="

With wxmaxima:

(%i2) compare(5,6);
(%o2) MLESSP
(%i3) compare(x,x+abs(x));
(%o3) MLEQP

I could change $compare to return &< instead of mlessp
and etc. That way xmaxima and wxmaxima would
both show the same result. Or maybe you could
change wxmaxima to display mlessp as "<".

Barton

@andrejv
Copy link
Collaborator Author

andrejv commented Apr 20, 2011

Submitted by andrejv

Logged In: YES
user_id=1179910

The display in cvs wxmaxima now matches the display in xmaxima.

Andrej

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant