Difference between revisions of "CoCoA:HowTo:Use Modular Numbers"
From ApCoCoAWiki
(Strange behaviour of modular numbers) |
m |
||
Line 27: | Line 27: | ||
------------------------------- | ------------------------------- | ||
The creation of a polynomial ring with no indeterminated has been disabled to highlight this (unexpected?) behaviour. | The creation of a polynomial ring with no indeterminated has been disabled to highlight this (unexpected?) behaviour. | ||
+ | |||
+ | [[Category:HowTo]][[Category:CoCoA4]] |
Revision as of 14:51, 29 November 2005
Question
What's wrong in this?
Use R::=Z/(5)[x]; 5x+2y; 2y ------------------------------- 5=0; FALSE -------------------------------
Moreover this command throws an error
Use R::=Z/(5);
Answer
Type(5); INT -------------------------------
5 is an integer, and integers do not depend on the current ring: could you imagine what would happen to a For cycle over Z/(2)? ;-)
If you want to use 5 as a modular number you should either use this syntax (similar to C/C++)
5 % 5; 0 % 5 -------------------------------
or embed your integer into the polynomial ring
Use R::=Z/(5)[x]; Poly(5); 0 -------------------------------
The creation of a polynomial ring with no indeterminated has been disabled to highlight this (unexpected?) behaviour.