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
sage.misc.functional.log(float(3)) raises an AttributeError #19444
Comments
Author: Frédéric Chapoton |
comment:1
Done. This should be an easy review. NOTA BENE: Getting rid of this log function (in favor of the one in functions.log) should be done in another ticket. I tried to do that, but sutmbled on the infamous import hell (import cycles everywhere). New commits:
|
Branch: u/chapoton/19444 |
Commit: |
comment:2
This implementation is very weak. How can you assume that this is supposed to be the real logarithm?
versus
|
comment:3
There is no need to make another perfect log, there is one already in functions.log, which is the one we provide as "log" in the global namespace. We should fix the issue raised here. And later get rid of this function, which is only used 10 times or so. |
comment:4
What is the point of fixing an issue on a useless function? If I open a ticket for the complex case will you fix it ;-? If useless, the log from functional would better be deprecated and this ticket closed as invalid. Anyway, the complaint is about |
comment:5
And indeed, there is something wrong with
The above is wrong since |
comment:6
And indeed, |
comment:7
See #23779 for the fix to |
comment:9
ok, done |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:11
If it turns out that for some reason I have used the bad log function in my code and I now get the following error message:
I will not understand and I will lose time to understand what is happening. I much prefer
|
Reviewer: Sébastien Labbé |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:13
Done |
comment:14
This is wrong: - k = int(ceil(log(n,2)))
+ k = int(ceil(RDF(n).log(2))) Do not use floating-point computations when you want an exact answer. An exception to this would be MPFR (used in Sage by So, you should either use |
comment:16
I would replace |
comment:18
ok ; but now there remains an RDF in "src/sage/rings/finite_rings/element_ntl_gf2e.pyx" |
comment:20
should be good now |
comment:21
In the light of |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:23
done |
comment:24
bot is morally green |
Changed branch from u/chapoton/19444 to |
import_statements
suggest to importlog
this way:While those works:
This one raises an
AttributeError
:A subquestion is why do we have two implementations of
log
?CC: @tscrim @jdemeyer @jhpalmieri
Component: basic arithmetic
Author: Frédéric Chapoton
Branch/Commit:
d2f7962
Reviewer: Sébastien Labbé
Issue created by migration from https://trac.sagemath.org/ticket/19444
The text was updated successfully, but these errors were encountered: