Skip to content

Commit

Permalink
Initialize uninitialized BigFloat array
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed May 25, 2024
1 parent f275f4e commit 2d0b7d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MaybeInplace"
uuid = "bb5d69b7-63fc-4a16-80bd-7e42200c7bdb"
authors = ["Avik Pal <[email protected]> and contributors"]
version = "0.1.2"
version = "0.1.3"

[deps]
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
Expand Down
5 changes: 5 additions & 0 deletions src/MaybeInplace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,11 @@ used by `@bangbang` to determine if an array can be setindex-ed or not.

@inline __similar(::CannotSetindex, x) = x
@inline __similar(::CanSetindex, x) = similar(x)
@inline function __similar(::CanSetindex, x::AbstractArray{<:BigFloat})
y = similar(x)
fill!(y, zero(eltype(y)))
return y

Check warning on line 296 in src/MaybeInplace.jl

View check run for this annotation

Codecov / codecov/patch

src/MaybeInplace.jl#L293-L296

Added lines #L293 - L296 were not covered by tests
end

const OP_MAPPING = Dict{Symbol, Function}(:copyto! => __copyto!!, :.-= => __sub!!,
:.+= => __add!!, :.*= => __mul!!, :./= => __div!!, :copy => __copy)
Expand Down

0 comments on commit 2d0b7d1

Please sign in to comment.