Another CAS.part() oddity

01062019, 07:09 PM
(This post was last modified: 01062019 07:09 PM by BruceH.)
Post: #1




Another CAS.part() oddity
Please see attached screenshot.
The top line was me entering []==[] but it displays as [[]]==[[]] Build 20181016 

01062019, 09:35 PM
(This post was last modified: 01062019 10:20 PM by compsystems.)
Post: #2




RE: Another CAS.part() oddity
Xcas with GIAC kernel
[]==[] [enter] returns true , ok compare two objects and these are equal HPPrime with GIAC kernel, and CAS MODE []==[] [enter] returns 1 =( Synonym of true, Although I do not know why the history shows [] as [[]] it seems to be another BUG related to the visualization of objects in the history view [up][up][copy] ([]) = [] [enter] [[]] ?? This is an BUG with the COPY function that I already reported a long time ago and do not a solution. Sometimes copy well []==[] [enter] [up][up][copy] (([])==[]) [enter] true part('RANDOM',2) [enter] "error the first argument must be a valid math expression" part('RANDOM(a)') [enter] 2, another BUG founds, must return 1 part('RANDOM(a)',0) [enter] "of" Another BUG founds, must return "RANDOM" part('RANDOM(a)',1) [enter] BUG, a ok part('5!') [enter] 1 ok, one parts part('5!',0) [enter] "factorial" ok (operator) part('5!',1) [enter] 5 ok (operating) part('abs(a)') [enter] 1 ok, one parts part('abs(a)',0) [enter] "ABS" part('abs(a)',1) [enter] a ok part(a) [enter] 1 ok, one parts,  it is an internal sign part(a,0) [enter] "" ok part(a,1) [enter] a ok test online part cmd session Xcas https://tiplanet.org/forum/portal.php 

01072019, 07:14 PM
Post: #3




RE: Another CAS.part() oddity
RANDOM is not a CAS command, try type('RANDOM')


01072019, 10:55 PM
Post: #4




RE: Another CAS.part() oddity
RANDOM is a NUMERIC command (HOME mode), type recognizes it as IDENTIFIER and it does not work, this BUG is caused by not incorporating the complete GIAC commands, this is an argument for the development group of the numerical part, try to incorporate the complete catalog of GIAC, except for what is impossible due to hardware or license problems
random is a CAS cmd, but it is not visible in the hpprime, like others, this causes inconsistencies, failures https://tiplanet.org/forum/portal.php 

01082019, 01:19 AM
Post: #5




RE: Another CAS.part() oddity
(01072019 07:14 PM)parisse Wrote: RANDOM is not a CAS command, try type('RANDOM') I'm not sure what you're suggesting here. I can't test for type('RANDOM') because I'm not in control of what users might supply as a parameter when they use my program. My program expects an expression (DOM_SYMBOLIC) as its parameter and type(part('expression',0)) is DOM_STRING for every expression. 

01082019, 01:40 AM
Post: #6




RE: Another CAS.part() oddity
PS: part('NOT 5') > DOM_SYMBOLIC as expected but part('NOT',0) gives a Syntax Error.
(Which is one for Tim, not parisse, I suspect.) 

01082019, 01:45 AM
Post: #7




RE: Another CAS.part() oddity  
01092019, 03:59 PM
(This post was last modified: 01092019 04:00 PM by informach.)
Post: #8




RE: Another CAS.part() oddity
Hi!, BruceH :
Conceptually the 'part' signify ... Returns the nth subexpression of an expression. part(Expr, Integer) Examples: part(sin(x)+cos(x),1) returns sin(x) part(sin(x)+cos(x),2) returns cos(x) 

« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)