diff --git a/Project.toml b/Project.toml index 02756e4..ae4f4f0 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Onda" uuid = "e853f5be-6863-11e9-128d-476edb89bfb5" authors = ["Beacon Biosignals, Inc."] -version = "0.15.4" +version = "0.15.5" [deps] Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45" diff --git a/src/samples.jl b/src/samples.jl index e608628..f24e826 100644 --- a/src/samples.jl +++ b/src/samples.jl @@ -365,7 +365,7 @@ end """ decode(sample_resolution_in_unit, sample_offset_in_unit, sample_data) -Return `sample_resolution_in_unit .* sample_data .+ sample_offset_in_unit`. +Return `fma.(sample_resolution_in_unit, sample_data, sample_offset_in_unit)`. If: @@ -379,7 +379,7 @@ function decode(sample_resolution_in_unit, sample_offset_in_unit, sample_data) if sample_data isa AbstractArray isone(sample_resolution_in_unit) && iszero(sample_offset_in_unit) && return sample_data end - return sample_resolution_in_unit .* sample_data .+ sample_offset_in_unit + return fma.(sample_resolution_in_unit, sample_data, sample_offset_in_unit) end """ @@ -389,7 +389,7 @@ Similar to `decode(sample_resolution_in_unit, sample_offset_in_unit, sample_data write decoded values to `result_storage` rather than allocating new storage. """ function decode!(result_storage, sample_resolution_in_unit, sample_offset_in_unit, sample_data) - f = x -> sample_resolution_in_unit * x + sample_offset_in_unit + f = x -> fma(sample_resolution_in_unit, x, sample_offset_in_unit) return broadcast!(f, result_storage, sample_data) end