Skip to content
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

Mathematical const e is not defined #447

Closed
siddMahen opened this issue Feb 22, 2012 · 8 comments
Closed

Mathematical const e is not defined #447

siddMahen opened this issue Feb 22, 2012 · 8 comments
Labels
kind:bug Indicates an unexpected problem or unintended behavior

Comments

@siddMahen
Copy link

The following should be added to float.j:

const e = 2.71828182845904523536

On another note, very cool idea.

@StefanKarpinski
Copy link
Sponsor Member

I think that taking a single-letter variable name for a global constant may be unacceptable. You can also do exp(1), although having a constant would be nice. The question is what's a good name for it. We went with im for the imaginary unit (rather than i which would steal a really common variable name). Maybe en?

@JeffBezanson
Copy link
Sponsor Member

I noticed, to my horror, that exp(1) differs from the above value by 1 ulp.

@StefanKarpinski
Copy link
Sponsor Member

Eeek!

@JeffBezanson
Copy link
Sponsor Member

Actually, exp(1) is giving the correct round-to-even answer. But in this case rounding down gets you a teensy bit closer. Maybe we should call the constant e1 or exp1?

@StefanKarpinski
Copy link
Sponsor Member

So that you can write twice Euler's constant as 2e1? Oh, wait, or does that mean 20.0? Oops. We definitely can't call it that. However, since it's Euler's constant, how about eu? Also possible would be E although that does also conflict with floating-point literal notation at the moment. I've never much understood allowing both 1e2 and 1E2, however.

@StefanKarpinski
Copy link
Sponsor Member

You know. Maybe using e isn't so bad after all. It doesn't prevent using e as the name of a parameter of a local variable, actually. And that's not really a very common variable name even. The only thing it prevents is using e as a variable at the global level. Which is acceptable. (In the case of i, on the other hand, I think that even that would be unacceptable.)

If we do this, we should make sure that expressions like 2e parse as 2*e. It's unambiguous since that's not valid floating-point literal anyway, but does require some look-ahead, rather than unconditionally committing to 2e always being the beginning of a float literal.

@JeffBezanson
Copy link
Sponsor Member

Ok, the 2e fix is in. We can now add e if you want.

@StefanKarpinski
Copy link
Sponsor Member

Closed by b092738.

LilithHafner pushed a commit to LilithHafner/julia that referenced this issue Oct 11, 2021
Keno pushed a commit that referenced this issue Oct 9, 2023
Revise has to be able to analyze code in modules that are not in
the namespace. It turns out that differences between how discovery
works in interactive mode (which implicitly widens the Manifest to
include all the stdlibs) and test-mode (which does not) have led to
the handling discovery of toplevel modules problematic for some time:
it turns out we've been constructing "shadow" modules of the same names
as these stdlibs. Some of the exclusions in Revise's `sigtest.jl` test
file reflect this.

This causes ExprSplitter to try harder to find modules from
`Base.__toplevel__`. When we can't resolve the name in the manifest,
we also check Base.loaded_modules and see if we can find something of
that name.

This fixes a bug that just manifested (but whose roots are old) for
Revise on nightly.
ViralBShah pushed a commit that referenced this issue Oct 16, 2023
Stdlib: SparseArrays
URL: https://github.com/JuliaSparse/SparseArrays.jl.git
Stdlib branch: main
Julia branch: master
Old commit: 4e6776a
New commit: 0f8bbda
Julia version: 1.11.0-DEV
SparseArrays version: 1.11.0
Bump invoked by: @ViralBShah
Powered by:
[BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl)

Diff:
JuliaSparse/SparseArrays.jl@4e6776a...0f8bbda

```
$ git log --oneline 4e6776a..0f8bbda
0f8bbda Interpolate SparseVector in display test (#455)
d884072 Merge pull request #427 from JuliaSparse/jishnub/sparsevecshow
9e68b7e Merge branch 'main' into jishnub/sparsevecshow
12a1c30 remove unnecessary inequality change
4217641 don't set Documenter compat
e86b148 Adapt to Documenter v1 (#444)
8c72535 Merge branch 'main' into jishnub/sparsevecshow
8c20ba1 Test for truncation
8f925f8 Interpolate Int in expected string
c53e1f2 interpolate struct in display test
33d4bf5 Undef show with MIME text/plain
034d234 Hook into new factorization dispatch mechanisms (#437)
248d0e6 Merge branch 'main' into jishnub/sparsevecshow
713ab9b Fix documentation of `findall` behaviour (#452)
cb9b31f rowvals instead of nonzeroinds
05ac950 Add example for UMFPACK control vector (#449)
605237e Add JL_UMFPACK_PIVOT_TOLERANCE to umfpack.jl (#447)
5dac134 Use a single header wrapper for all platforms. (#446)
47e26dd Explicit types in test RHS
c123952 Interpolate vectors in show test
b309da7 Explicit types
d21fc79 Add test for showing a vector of sparsevec
3e918e4 Restore unfilled sparsevec display
b533818 Don't add SparseArrays to docs/Project.toml
4449100 Remove commented out method
728e116 ignore docs/build
99a0db2 Merge show methods
ac5c8ed Switch from internal 5-arg `searchsorted*` methods to views (#440)
ada9edd sparse vector views remain sparse (#416)
c93065c Improved the dot product between two vectors and a sparse matrix (#410)
2fae1a1 Correctly set zeros with `fill!(::SubArray)` and fix its return value (#433)
03ed9e3 Code quality cleanup (#438)
559a74e Merge branch 'main' into jishnub/sparsevecshow
8944160 fix empty show
e72223d One-line show for SparseVector
```

Co-authored-by: Dilum Aluthge <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants