Post Reply 
Another CAS.part() oddity
01-06-2019, 07:09 PM (This post was last modified: 01-06-2019 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 2018-10-16


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
01-06-2019, 09:35 PM (This post was last modified: 01-06-2019 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

HP-Prime 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
Find all posts by this user
Quote this message in a reply
01-07-2019, 07:14 PM
Post: #3
RE: Another CAS.part() oddity
RANDOM is not a CAS command, try type('RANDOM')
Find all posts by this user
Quote this message in a reply
01-07-2019, 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
Find all posts by this user
Quote this message in a reply
01-08-2019, 01:19 AM
Post: #5
RE: Another CAS.part() oddity
(01-07-2019 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.
Find all posts by this user
Quote this message in a reply
01-08-2019, 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.)
Find all posts by this user
Quote this message in a reply
01-08-2019, 01:45 AM
Post: #7
RE: Another CAS.part() oddity
(01-06-2019 09:35 PM)compsystems Wrote:  part('RANDOM(a)') [enter] 2, another BUG founds, must return 1

part(expr), i.e. with just one parameter, seems to be a synonym for length(expr). So an undocumented feature rather than a bug.
Find all posts by this user
Quote this message in a reply
01-09-2019, 03:59 PM (This post was last modified: 01-09-2019 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)
Find all posts by this user
Quote this message in a reply
Post Reply 




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