Allowing floating-point values to specify array lengths was discussed pretty early on in the development of Julia (in 2011!), and was ultimately rejected. See the discussion here Matrix constructors should be able to take floating point value for size · Issue #136 · JuliaLang/julia · GitHub and here Pass integer valued floats to matrix constructors · Issue #1972 · JuliaLang/julia · GitHub and here zeros(1e4) -> ERROR: no method Array(DataType,Float64) · Issue #4275 · JuliaLang/julia · GitHub for example.
stevengj
10
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| A most harrowing collection of Julia WATs | 108 | 12829 | January 27, 2024 | |
| Range(stop) | 17 | 3017 | January 22, 2021 | |
| Type restriction on UnitRange | 17 | 1635 | October 21, 2017 | |
| Syntax Surprises | 83 | 6353 | January 21, 2023 | |
| UndefVarError: linspace not defined | 40 | 41574 | July 30, 2020 |