# [sage-devel] dontfactor parameter in factor() still factoring.

```

I’ve simplified, as much as I can, the problem to the following example,
consider:```
```

*sage:* var(‘n, k, t’)

(n, k, t)                                     # good

*sage:* p=1/2*(n*pi/k + t)

*sage:* p

1/2*pi*n/k + 1/2*t                       # acceptable expansion but not
perfect: should be n*pi not pi*n

*sage:* p.factor()

1/2*(pi*n + k*t)/k                       # acceptable (see previous remark,
also note, 1/2 and k are factored, ok)

*sage:* p.factor()

1/2*(pi*n + k*t)/k                       # good (nothing changed, yet only
acceptable expansion, as ditto, 1/2 and k still factoring, fine)

*sage:* p.factor(dontfactor=[k])

1/2*(pi*n + k*t)/k                       # bad (factors k still: dontfactor
not recognized for k), 1/2 factored as should be.

*sage:* p.factor(k)

1/2*(pi*n + k*t)/k                       # bad (factors k still: dontfactor
not recognized for k), 1/2 factored as should be.

Should be:

1/2*(pi*n/k + t) or ideally, 1/2*(n*pi/k + t), note the placement of the
"n" (yes it is important for non-commutating algebras).

badfactor is not recognizing dontfactor variable “k”, yet does factor “1/2”
like it should.

In more sophisticated constructs, this problem creates great problems of
needless equation complexity.

Or am I using "dontfactor" incorrectly?

Regards,

Dorian

--
You received this message because you are subscribed to the Google Groups
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email