# ANN: Measurements.jl v0.4.0

**URL:** https://discourse.julialang.org/t/ann-measurements-jl-v0-4-0/3397
**Category:** Community
**Tags:** announcement, measurements
**Created:** [April 27, 2017, 8:02am UTC](https://discourse.julialang.org/t/ann-measurements-jl-v0-4-0/3397 "2017-04-27T08:02:57Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [April 27, 2017, 8:02am UTC](https://discourse.julialang.org/t/ann-measurements-jl-v0-4-0/3397/1 "2017-04-27T08:02:57Z")

</div>

I’m happy to announce the release of the version 0.4.0 if [`Measurements.jl`](https://github.com/giordano/Measurements.jl), an [error propagation](https://en.wikipedia.org/wiki/Propagation_of_uncertainty) package for physical measurements, carefully taking functional correlation between them into account. This library supports real and complex numbers with uncertainty, arbitrary precision calculations, operations with arrays, and much more. As usual, the complete documentation is available at [Measurements.jl — Measurements.jl 0.4.1-dev documentation](https://measurementsjl.readthedocs.io/en/latest/).

These are the new in the latest version:

> ### Breaking Changes

> - Support for Julia 0.4 and 0.5 was dropped.
> - `value` and `uncertainty` functions are no more exported.
> - `Measurements.gradient` function has been removed. Use the vectorized function `Measurements.derivative.(x, array)` instead.

> ### Improvements

> - There were several performance improvements, both in speed and memory usage. These improvements are more evident for simple operations like addition and subtraction (now these operations are 2-3 times faster than in v0.3.0). In addition, the overhead of operations with arrays of `Measurement`s and complex `Measurement`s was greatly reduced by avoiding useless conversions (now summing an array is 100 times faster than in v0.3.0).

> ### New Features

> - `quadgk` function from [`QuadGK.jl`](https://github.com/JuliaMath/QuadGK.jl) package is extended to support `Measurement` objects as endpoints of integration ([#8](https://github.com/giordano/Measurements.jl/pull/8)). Note that only the case of two real endpoints is supported.
> - Real `Measurement` objects can be printed with `"text/x-tex"` and `"text/x-latex"` MIME types. `\pm` TeX macro is used to render the `±` sign.
> - A new `parse` method is provided, to parse a string to `Measurement{Float64}`. This is the same as calling `measurement` with a string argument.

In particular, I’ve worked towards making calculations as fast as possible, removing some useless steps. A few microbenchmarks are presented at [Performance — Measurements.jl 0.4.0 documentation](https://measurementsjl.readthedocs.io/en/stable/performance.html).

I also managed to enable computation of numerical integrals with `Measurement` objects as integration bounds using `QuadGK` (which already supports integration of custom Julia types as integrands). I couldn’t find other similar packages in other languages with this feature. For instance, this new feature allows for cosmological calculations involving numbers with uncertainties (like cosmological parameters measured by the experiments): [Using Measurements, including errors in cosmology constants and redshift · Issue #7 · JuliaAstro/Cosmology.jl · GitHub](https://github.com/JuliaAstro/Cosmology.jl/issues/7). Other examples of out-of-the-box integration with third-party packages (like numerical and automatic differentiation, and packages for numbers with physical units) are shown at [Examples — Measurements.jl 0.4.0 documentation](https://measurementsjl.readthedocs.io/en/stable/examples.html#interplay-with-third-party-packages). The great Julia type system is instrumental in making all this work so easily!

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [July 10, 2017, 9:36am UTC](https://discourse.julialang.org/t/ann-measurements-jl-v0-4-0/3397/2 "2017-07-10T09:36:59Z")

</div>

A couple of days ago, I tagged a new minor version of [`Measurements.jl`](https://github.com/JuliaPhysics/Measurements.jl), `v0.5.0`. This is the list of changes:

> ### Breaking Changes

> - `isinteger` and `iszero` now check also that the uncertainty is zero.
> - Comparison between `Measurement` and `Real` with `==` now compares also the  
> uncertainty, so that the `Measurement` must have uncertainty equal to zero to  
> be equal to a real number.
> - Comparison between `Measurement` and `Irrational` with `==` now gives always  
> `false`, consistently with the rest of `Real` types.

> ### New Features

> - New mathematical operations supported: `sinpi`, `cospi`, `sinc`, `cosc`,  
> `asec`, `acsc`, `acot`, `asech`, `acsch`, `acoth`, `sincos` (the last one only  
> on Julia 0.7).
> - It is now possible to parse a string as a `Measurement{T}` with any  
> `T<:AbstractFloat` (not only `Measurement{Float64}`), as long as the parsing  
> method is able to digest the string. Tested with `T` equal to `Float16`,  
> `Float32`, `Float64`, and `BigFloat`.

There is also a change under the hood, not mentioned above, inspired by [this thread](https://discourse.julialang.org/t/trouble-with-measurements-jl-and-bessel-functions/4562): it is possible to [define a macro](https://discourse.julialang.org/t/trouble-with-measurements-jl-and-bessel-functions/4562/6) to numerically propagate the uncertainty of a complex-valued function of one complex argument, not supported out-of-the-box by the package (like complex special functions).
