Opened 5 years ago
Last modified 4 years ago
#21745 needs_work enhancement
Standardize modulo operator % on real numbers (step 1)
Reported by:  vdelecroix  Owned by:  

Priority:  major  Milestone:  sage7.5 
Component:  basic arithmetic  Keywords:  
Cc:  tmonteil  Merged in:  
Authors:  Vincent Delecroix  Reviewers:  
Report Upstream:  N/A  Work issues:  
Branch:  u/vdelecroix/21745 (Commits, GitHub, GitLab)  Commit:  39f4053cc260b5816cde2faa816e7be72617d4ba 
Dependencies:  Stopgaps: 
Description (last modified by )
For any subset of the real numbers we change the modulo operator to be
x%y is the unique x' between [0,y) of the form x + ny with n integer
The main reason for the shift are the following incoherences
sage: 5 % 3 2 sage: 5. % 3. 1.00000000000000
and
sage: 2/5 % 3 1 sage: 2./5. % 3. 0.400000000000000
The change mainly affects QQ and RR. This ticket concentrates on QQ. For other numbers see #21747.
The specifications for the transition period are as follows:
 both
//
and%
with rational arguments will return rationals  there will be a deprecation warning with
(p/q) % (r/s)
whenp/q
orr/s
is not an exact integer  there will be a deprecation warning with
(p/q) // (r/s)
when the result is not an exact integer
See this sagedevel thread and also #15260
Change History (16)
comment:1 Changed 5 years ago by
 Cc tmonteil added
comment:2 Changed 5 years ago by
 Dependencies set to #21746
comment:3 Changed 5 years ago by
 Description modified (diff)
comment:4 Changed 5 years ago by
 Branch set to u/vdelecroix/21745
 Description modified (diff)
 Status changed from new to needs_review
 Summary changed from Standardize modulo operator % on real numbers to Standardize modulo operator % on real numbers (step 1)
comment:5 Changed 5 years ago by
 Commit set to 710eee221d82bf66b7a2b1f4234dd4877d140a9a
comment:6 Changed 5 years ago by
 Commit changed from 710eee221d82bf66b7a2b1f4234dd4877d140a9a to 71f5d5900cfb54fca4d472401999baae24b9792c
Branch pushed to git repo; I updated commit sha1. New commits:
71f5d59  21745: fix a UTF8 character

comment:7 Changed 5 years ago by
 Commit changed from 71f5d5900cfb54fca4d472401999baae24b9792c to 1bbc03ca2e75800cbe6b90eefd5dd44665a97c19
Branch pushed to git repo; I updated commit sha1. New commits:
1bbc03c  21745: better documentation in real_mod_floordiv.py

comment:8 Changed 5 years ago by
 Commit changed from 1bbc03ca2e75800cbe6b90eefd5dd44665a97c19 to 851792263137eba893897312c7778cf57c9050c9
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
8517922  21745: better documentation in real_mod_floordiv.py

comment:9 Changed 5 years ago by
 Description modified (diff)
comment:10 Changed 5 years ago by
 Commit changed from 851792263137eba893897312c7778cf57c9050c9 to 69123710378e0041d641ab336439d4ba9dcb3099
comment:11 Changed 5 years ago by
 Commit changed from 69123710378e0041d641ab336439d4ba9dcb3099 to 2bd9c73ebd4352eae2bd9fdf2adbec55349b69aa
Branch pushed to git repo; I updated commit sha1. New commits:
2bd9c73  21745: make floordiv returns a rational

comment:12 Changed 5 years ago by
 Description modified (diff)
comment:13 Changed 5 years ago by
 Description modified (diff)
comment:14 Changed 4 years ago by
 Commit changed from 2bd9c73ebd4352eae2bd9fdf2adbec55349b69aa to 39f4053cc260b5816cde2faa816e7be72617d4ba
Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:
9decbae  21745: doctest finite field initialization

25a335e  21745: fix quadratic form of ideals

ad9f818  21745: fix some french book examples

f2ceaf1  21745: fix a UTF8 character

2d78c1d  21745: better documentation in real_mod_floordiv.py

5b720f4  21745: fix quadratic_forms

c45b553  21745: fix in root system

6e16f4d  21745: two fixes in graphs/

7aa12c5  21745: make floordiv returns a rational

39f4053  21745: fix projective_morphism.py

comment:16 Changed 4 years ago by
 Status changed from needs_review to needs_work
failing doctests (see patchbot)
Branch pushed to git repo; I updated commit sha1. Last 10 new commits:
21745: fix integer mod ring initialization with rationals
21745: fix doctests in integer.pyx
21745: use / instead of // in one place
21745: include real_mod_floordiv in the documentation
21745: fix bernoulli mod p tests
21745: fix pari ffelt initialization
21745: fix doctests in ideal.py and integer_ring.pyx
21745: doctest finite field initialization
21745: fix quadratic form of ideals
21745: fix some french book examples