Timeline for answer to Separate or order the positive and negative terms of an expression by Carl Woll
Current License: CC BY-SA 3.0
Post Revisions
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 1, 2018 at 17:25 | comment | added | Carl Woll | @Balazs Please see update. | |
| May 1, 2018 at 17:25 | history | edited | Carl Woll | CC BY-SA 3.0 |
Add version to address comment
|
| May 1, 2018 at 16:40 | comment | added | Balazs | I have found this thread by searching and found this routine really useful. Is there a way to modify it though so that it always returns a two-element list? For now, posneg[x] and posneg[-x] give me one-element lists {x} and {-x}, whereas I would prefer {x,0} and {0,-x} so that I can use First[posneg[p]] and Last[posneg[p]] uniformly as positive and negative parts of some polynomial p. | |
| Jan 18, 2018 at 16:01 | comment | added | AzJ | @CarlWoll Thanks just what I was looking for. | |
| Jan 18, 2018 at 16:00 | vote | accept | AzJ | ||
| Jan 18, 2018 at 3:39 | comment | added | Carl Woll |
@MichaelE2 I wanted the function to work for both Plus and non-Plus objects. Thanks for catching the error.
|
|
| Jan 18, 2018 at 3:38 | history | edited | Carl Woll | CC BY-SA 3.0 |
Fix bug
|
| Jan 18, 2018 at 3:08 | comment | added | Michael E2 |
Did you want List @@ expr instead of List @@ Flatten[{expr}]?
|
|
| Jan 18, 2018 at 1:26 | history | edited | Carl Woll | CC BY-SA 3.0 |
Add function
|
| Jan 17, 2018 at 23:23 | comment | added | AzJ | Looks great. Can it be written so that it can be defined once and used as a function. | |
| Jan 17, 2018 at 23:03 | history | answered | Carl Woll | CC BY-SA 3.0 |