Skip to content

std(::AbstractVector{Float32}, ::AnalyticWeights{Float32}) gives a Float64 #680

Open
@oxinabox

Description

@oxinabox

Setup:

julia> using StatsBase, Statistics

julia> xs = Float32[1, 2, 3, 4, 5];

julia> ws = AnalyticWeights(Float32[1, 1, 1, 1, 1]);

julia> eltype(ws)
Float32

Now trying some operations

julia> typeof(std(xs))  # As expected
Float32


julia> typeof(mean(xs, ws))  # as expected
Float32

julia> typeof(std(xs, ws))  # Not expected Should be a Float32
Float64

I was pretty sure this used to work to give a Float32
if so, I can't work-out when it changed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions