Post Reply 
Easy as { 1 2 3 }? (when { 1 2 3 } ≠ { 1 2 3 })
07-17-2018, 04:51 PM
Post: #22
RE: Easy as { 1 2 3 }?
(07-17-2018 04:00 PM)ttw Wrote:  The SIGN function behaves strangely too.

{0 1 -1 0. 1. -1,} SIGN yields {'?' 1 -1 0. 1. -1.}

It has taken a bit of work to get around this behavior. For a list 'X' I usually do:

X 1. * SIGN XQ

The behaviour is exactly as described in the AUR:
"In exact mode, the sign for argument 0 is undefined (?). In approximate mode, the sign for argument 0 is 0"

Your first 0 is an exact 0 (no trailing decimal mark), hence the undefined result. By multiplying with 1. (approximate 1) you are making all elements approximate, hence 0 will become 0. and the result of SIGN will be 0. as described. (Interesting that you then convert the result to all numbers to quotient (exact) format when half your list was decimal format to start with).

Also if you set Flag -03 then SIGN will return {0. 1. -1. 0. 1. -1.}
.


Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Easy as { 1 2 3 }? - Joe Horn - 07-15-2018, 12:52 AM
RE: Easy as { 1 2 3 }? - DavidM - 07-15-2018, 01:41 AM
RE: Easy as { 1 2 3 }? - Joe Horn - 07-15-2018, 04:12 AM
RE: Easy as { 1 2 3 }? - DavidM - 07-15-2018, 04:52 AM
RE: Easy as { 1 2 3 }? - Claudio L. - 07-15-2018, 05:54 PM
RE: Easy as { 1 2 3 }? - DavidM - 07-15-2018, 06:07 PM
RE: Easy as { 1 2 3 }? - Claudio L. - 07-16-2018, 04:25 AM
RE: Easy as { 1 2 3 }? - DavidM - 07-17-2018, 03:05 AM
RE: Easy as { 1 2 3 }? - rprosperi - 07-17-2018, 03:26 AM
RE: Easy as { 1 2 3 }? - DavidM - 07-17-2018, 03:31 AM
RE: Easy as { 1 2 3 }? - Massimo Gnerucci - 07-17-2018, 06:33 AM
RE: Easy as { 1 2 3 }? - John Keith - 07-17-2018, 12:32 PM
RE: Easy as { 1 2 3 }? - Massimo Gnerucci - 07-17-2018, 02:11 PM
RE: Easy as { 1 2 3 }? - John Keith - 07-17-2018, 08:49 PM
RE: Easy as { 1 2 3 }? - John Keith - 07-15-2018, 01:01 PM
RE: Easy as { 1 2 3 }? - Dave Britten - 07-15-2018, 02:38 PM
RE: Easy as { 1 2 3 }? - DavidM - 07-15-2018, 05:21 PM
RE: Easy as { 1 2 3 }? - Eddie W. Shore - 07-17-2018, 12:43 PM
RE: Easy as { 1 2 3 }? - rprosperi - 07-17-2018, 01:06 PM
RE: Easy as { 1 2 3 }? - DavidM - 07-17-2018, 01:41 PM
RE: Easy as { 1 2 3 }? - John Keith - 07-17-2018, 08:42 PM
RE: Easy as { 1 2 3 }? - ttw - 07-17-2018, 04:00 PM
RE: Easy as { 1 2 3 }? - BartDB - 07-17-2018 04:51 PM
RE: Easy as { 1 2 3 }? - pier4r - 08-07-2018, 04:07 PM



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