-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
add int_valued function
#25640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add int_valued function
#25640
Conversation
|
✅ Hi, I am the SymPy bot. I'm here to help you write a release notes entry. Please read the guide on how to write release notes. Your release notes are in good order. Here is what the release notes will look like:
This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.13. Click here to see the pull request description that was parsed.
Update The release notes on the wiki have been updated. |
7a20c49 to
370e355
Compare
bbd7f94 to
60468c9
Compare
|
Benchmark results from GitHub Actions Lower numbers are good, higher numbers are bad. A ratio less than 1 Significantly changed benchmark results (PR vs master) Significantly changed benchmark results (master vs previous release) | Change | Before [8059df73] <sympy-1.12^0> | After [c84dc53e] | Ratio | Benchmark (Parameter) |
|----------|------------------------------------|---------------------|---------|----------------------------------------------------------------------|
| - | 84.0±1ms | 55.0±0.4ms | 0.65 | integrate.TimeIntegrationRisch02.time_doit(10) |
| - | 84.7±1ms | 53.7±0.5ms | 0.63 | integrate.TimeIntegrationRisch02.time_doit_risch(10) |
| + | 20.0±0.1μs | 39.7±0.2μs | 1.99 | integrate.TimeIntegrationRisch03.time_doit(1) |
| - | 6.80±0.01ms | 3.67±0.01ms | 0.54 | logic.LogicSuite.time_load_file |
| - | 2.10±0ms | 615±3μs | 0.29 | polys.TimePREM_LinearDenseQuadraticGCD.time_op(3, 'sparse') |
| - | 10.4±0.03ms | 1.86±0.01ms | 0.18 | polys.TimePREM_LinearDenseQuadraticGCD.time_op(5, 'sparse') |
| - | 361±2μs | 78.9±0.4μs | 0.22 | polys.TimePREM_QuadraticNonMonicGCD.time_op(1, 'sparse') |
| - | 4.70±0.01ms | 345±0.7μs | 0.07 | polys.TimePREM_QuadraticNonMonicGCD.time_op(3, 'sparse') |
| - | 10.5±0.02ms | 1.04±0ms | 0.1 | polys.TimePREM_QuadraticNonMonicGCD.time_op(5, 'sparse') |
| - | 6.21±0.02ms | 3.82±0.01ms | 0.61 | polys.TimeSUBRESULTANTS_LinearDenseQuadraticGCD.time_op(2, 'sparse') |
| - | 27.5±0.03ms | 11.6±0.03ms | 0.42 | polys.TimeSUBRESULTANTS_LinearDenseQuadraticGCD.time_op(3, 'sparse') |
| - | 6.77±0.04ms | 1.13±0ms | 0.17 | polys.TimeSUBRESULTANTS_QuadraticNonMonicGCD.time_op(1, 'sparse') |
| - | 15.8±0.06ms | 8.91±0.01ms | 0.57 | polys.TimeSUBRESULTANTS_QuadraticNonMonicGCD.time_op(2, 'sparse') |
| - | 205±0.3ms | 68.4±0.07ms | 0.33 | polys.TimeSUBRESULTANTS_QuadraticNonMonicGCD.time_op(3, 'sparse') |
| - | 6.36±0.02ms | 504±2μs | 0.08 | polys.TimeSUBRESULTANTS_SparseGCDHighDegree.time_op(3, 'sparse') |
| - | 27.3±0.08ms | 803±2μs | 0.03 | polys.TimeSUBRESULTANTS_SparseGCDHighDegree.time_op(5, 'sparse') |
| - | 591±1μs | 201±0.9μs | 0.34 | polys.TimeSUBRESULTANTS_SparseNonMonicQuadratic.time_op(1, 'sparse') |
| - | 6.32±0.02ms | 205±0.7μs | 0.03 | polys.TimeSUBRESULTANTS_SparseNonMonicQuadratic.time_op(3, 'sparse') |
| - | 16.4±0.02ms | 207±0.6μs | 0.01 | polys.TimeSUBRESULTANTS_SparseNonMonicQuadratic.time_op(5, 'sparse') |
| - | 162±0.5μs | 90.5±0.2μs | 0.56 | solve.TimeMatrixOperations.time_rref(3, 0) |
| - | 306±0.5μs | 106±0.3μs | 0.35 | solve.TimeMatrixOperations.time_rref(4, 0) |
| - | 29.9±0.03ms | 12.7±0.04ms | 0.43 | solve.TimeSolveLinSys189x49.time_solve_lin_sys |
Full benchmark results can be found as artifacts in GitHub Actions |
|
Looks good! |
References to other Issues or PRs
Brief description of what is fixed or changed
This adds a function that indicates, regardless of precision, whether an expression is a Number with no decimal portion, e.g.
Float(3)but notFloat(3.1).Done in anticipation of #25614 but useful whether that is committed or not.
Other comments
I am note sure what to do about
int_valued(1e23) -> True; it is true that it has no remainder but it is also not what one might expect:How do I determine whether a number will suffer from precision loss or not? It seems that the only way to know is to store, at instantiation, a flag that indicates how the number was passed (string vs float, for example).
Release Notes
int_valuedfunction to sympy/core/numbers.py for testing whether an expression is a literal number with no decimal portion