Comments (3)
There are five files xaa, xab, xac, xad, xae each with around 72 potential cases to check.
Here are the suspicious cases per file after volunteers examined the files. Each will have to be checked very carefully and/or fixed.
xaa:
No problems to report.
xab:
There is no cast here:
fmpz/cdiv_q_ui.c: fmpz_set_si(f, - (((ulong) -c1) / c2))
There might be more casts as well when defining q et al. checked OK
Same for fmpz/fdiv_q.c and other division files. Also note the
discrepancy in the types used there and in the previous file (most
division files seem to follow this latter file convention). checked OK
Also check fmpz/add.c and fmpz/fdiv_q_ui.c. checked OK
This one looks dangerous:
fmpz/cdiv_q_2exp.c: fmpz_set_si(f, -((-d) >> FLINT_MIN(exp, should be OK
FLINT_BITS - 2)));
I'm not sure what the C standard says about right shifts.
No cast from ulong to slong here (though the result is > 0):
fmpz/multi_CRT_ui.c: fmpz_set_si(output, residues[0] - p); checked OK
In fmpz/xgcd_partial.c a few slong are fed to _ui functions which should be ok. checked OK
In
fmpz/is_prime_morrison.c: fmpz_set_si(B, b); b FIXED
is a mp_limb_t
In
fmpz/add_ui.c: fmpz_set_si(f, x + c checked OK
ulong + slong.
xac:
fmpz/divexact_ui.c: fmpz_set_si(f, c1 / (slong) h); checked OK
fmpz/invmod.c: return (gcd == UWORD(1) ? fmpz_set_si(f, inv), 1 : 0); checked OK
fmpz/invmod.c: return (gcd == UWORD(1) ? fmpz_set_si(f, inv), 1 : 0); checked OK
fmpz.h: fmpz_set_si(f, x - m); checked OK
fmpz_mat/hadamard.c: fmpz_set_si(fmpz_mat_entry(Q, r, c), checked OK
xad:
No problems to report.
xae:
No problems to report.
from flint2.
The one in fmpz_mat/hadamard.c: is OK; the argument type is actually int. The longs are safe also and could be changed to either int or slong. In fact all the fmpz values being set in this file are -1, 0, 1.
from flint2.
Thanks for checking. I may as well set the longs to slongs, just so we
don't keep examining the same thing in future.
On 30 July 2015 at 16:58, Fredrik Johansson [email protected]
wrote:
The one in fmpz_mat/hadamard.c: is OK; the argument type is actually int.
The longs are safe also and could be changed to either int or slong. In
fact all the fmpz values being set in this file are -1, 0, 1.—
Reply to this email directly or view it on GitHub
#32 (comment).
from flint2.
Related Issues (20)
- Calling make after build is complete is time consuming
- Improve generic expression parsing
- Implement more multiplication with ADX instructions
- make install fails on openbsd - wrong parameter to ldconfig, etc HOT 13
- Improve Hensel lifting as used in fmpz_poly_factor
- name clash with Singular's `fq_nmod_set_nmod_poly` HOT 4
- There is no fmpz_mod_mat_det HOT 1
- fmpz_mat_charpoly doesn't use the best algorithm in all cases HOT 1
- Improve _fmpz_vec_dot
- Integrate code from PML
- Waksman multiplication
- Shortcut for running tests HOT 1
- Many div and divrem calls shouldn't be
- Nightly CI for software using FLINT HOT 4
- License change to GMP-compatible license HOT 6
- Unified layout for context objects
- calculating 1F1 HOT 7
- Multivariate fractions with factored denominator
- Performance regression in fmpz_mpoly HOT 9
- Use a GPU to increase performance HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flint2.