> 
> I'd consider the following a bug, since -1 is an Integer.  But I'm not
> sure. What do you think,
> 
> Martin
> 
> (23) -> sqrt -1
> 
>    (23)  sqrt - 1
>                                                     Type: Polynomial(Integer)
> 

Looks like a parsing problem:

(5) -> parse("sqrt -1")$InputForm

   (5)  (- sqrt 1)
                                                              Type: InputForm
(6) -> parse("sqrt(-1)")$InputForm

   (6)  (sqrt (- 1))
                                                              Type: InputForm
(7) ->

I have first written "parser bug", but then I realised if you
want to speak about bug, then the bug is really allowing 
function application without parentheses.  Namely, from
parser point of view "x -1" and "sqrt -1" are the same
thing: either you have function x applied to -1 (unary minus
applied to 1) or binary minus.  If you require parenthesis
for function application than this ambiguity vanishes.
If you have function application without parenthesis you
need some more or less arbitrary rules to make a choice.
Current rule (preferring binary operator) works as intended
in many cases, but sometimes you are surprised by the result.

-- 
                              Waldek Hebisch
[EMAIL PROTECTED] 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to