## reduce-algebra-developers — Discussion of development, administration and support for Reduce

You can subscribe to this list here.

 2009 2010 2011 2012 2013 2014 2015 Jan (2) Feb (5) Mar Apr May (2) Jun (8) Jul (4) Aug Sep Oct (2) Nov (6) Dec Jan (1) Feb (1) Mar (3) Apr (2) May (2) Jun (2) Jul (18) Aug (13) Sep (7) Oct Nov Dec (2) Jan Feb (11) Mar Apr (4) May Jun (1) Jul (18) Aug (16) Sep (12) Oct (12) Nov (19) Dec (42) Jan (16) Feb (3) Mar (8) Apr (14) May (30) Jun (5) Jul (7) Aug (3) Sep (10) Oct (4) Nov (10) Dec (1) Jan (14) Feb (8) Mar (5) Apr (3) May (9) Jun (19) Jul Aug (27) Sep (5) Oct (18) Nov (12) Dec (8) Jan (5) Feb (8) Mar (20) Apr (22) May (28) Jun (9) Jul (6) Aug (46) Sep (40) Oct (15) Nov (8) Dec (34) Jan (20) Feb (15) Mar (18) Apr (20) May (3) Jun (13) Jul (10) Aug (19) Sep (8) Oct (18) Nov Dec
S M T W T F S

1

2

3

4
(5)
5

6

7
(1)
8

9
(1)
10

11

12
(1)
13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

Showing 1 results of 1

 Re: [Reduce-algebra-developers] Abs operator and domain elements From: Rainer Schöpf - 2013-02-12 08:51:46 ```On Sat, 9 Feb 2013 at 10:52 -0000, Alan Barnes wrote: > Regarding the 'feature' when the operator abs is applied to ps domain > elements, I agree with Rainer that taking the sign of the coefficient of > the lowest order term would be a quick fix when the coefficient is > numeric. When the coefficient is algebraic, abs could simply return abs > of its argument as it does for 'normal' algebraic expressions . The problem is that the current code for computing the absolute value of a domain element uses the only interface the domain mode code offers: a function returning t when a domain element is positive, nil otherwise. This approach doesn't really work for non-constant domain elements. So, yes, the quick fix works for the case in question, but it requires already a couple of changes to the tps code to make that one example work. I'm not sure what other places in the code there are that might be affected. > Alternatively abs could simply return abs of its argument; correct but > not very useful! Yes, but what can one do in general? The more I think about this, the more I believe that "abs" is another special case that needs its own (optional) domain mode function, like for "expt". It is then the responsibility of the specific domain element code to compute the absolute value of a domain element. It might even be a good idea to have a "constant/nonconstant" flag for a domain mode. To give one reason: the function constant_exprp returns t for an integer argument, but nil for a constant domaion element like (!:rd!: . 1.0) . Rainer ```

Showing 1 results of 1