Skip to content

Releases: emmt/TypeUtils.jl

v1.12.0

21 Oct 06:44

Choose a tag to compare

TypeUtils v1.12.0

Diff since v1.11.0

Fixed

  • get_precision on n-tuples yields a correct result and is inferable.

Added

  • get_precision() yields AbtractFloat instead of throwing a MethodError.

v1.11.0

16 Oct 15:08

Choose a tag to compare

TypeUtils v1.11.0

Diff since v1.10.0

Fixed

  • Fix tests for Julia 1.12 and above.

  • Syntax @public a, b, c is allowed.

Merged pull requests:

v1.10.0

25 Jul 10:59

Choose a tag to compare

TypeUtils v1.10.0

Diff since v1.9.0

Added

  • With multiple arguments, get_precision(x, y...) yields the best precision of all the given arguments.

  • nearest(T, x) can deal with dimensionful numbers and types.

v1.9.0

20 Jun 06:57

Choose a tag to compare

TypeUtils v1.9.0

Diff since v1.8.0

This new minor version adds methods to deal with the numerical precision of numbers and objects.

Added

  • get_precision(x) yields the numerical precision of x.

  • adapt_precision(T, x) yields a version of x with numerical precision T.

  • destructure(Vector, x) and destructure(Vector{T}, x) yield a vector while destructure(Tuple, x) yields a tuple as destructure(x).

v1.8.0

19 Jun 03:54

Choose a tag to compare

TypeUtils v1.8.0

Diff since v1.7.1

Added

  • convert_eltype(T,A) for A an instance of LinearAgebra.Factorization.

  • Tests with Aqua.jl.

Fixed

  • A few minor things detected by Aqua.jl have been fixed.

  • Better rule for element type conversion of AbstractUnitRange instances.

  • Fix specialization of Base.return_types which shall return a vector of types.

v1.7.1

19 May 22:06

Choose a tag to compare

TypeUtils v1.7.1

Diff since v1.7.0

Fixed

  • is_signed(x) is false if x is a complex number with unsigned rational parts.

v1.7.0

13 May 14:39

Choose a tag to compare

TypeUtils v1.7.0

Diff since v1.6.0

  • New is_signed method to infer whether a value of a given numeric type can be negated while retaining the same type.
  • Extend similar for the type of arrays returned by as_eltype.

v1.6.0

15 Apr 11:04

Choose a tag to compare

TypeUtils v1.6.0

Diff since v1.5.1

Added

  • Macro @assert_floating_point to assert whether arguments or variables of a function do use floating-point for storing their value(s).

  • New function assert_floating_point to assert whether an object does use floating-point for storing its value(s). This method is a trait: its result only depend on the type of its argument and this type may be directly specified.

Fixed

  • @public can take macro names (prefixed by @) as argument.

v1.5.1

12 Apr 09:33

Choose a tag to compare

TypeUtils v1.5.1

Diff since v1.5.0

Changed

  • Relax type restriction on T in convert_bare_type(T, x), convert_real_type(T, x), and convert_floating_point_type(T, x).

Fixed

  • Fix new_array(T) and new_array(T,()) yield a 0-dimensional array.

v1.5.0

14 Mar 12:00

Choose a tag to compare

TypeUtils v1.5.0

Diff since v1.4.2

  • Non-exported public constructor c = TypeUtils.Converter(f,T::Type) such that c is callable and c(x) yields f(T,x) for any x. This replaces and generalizes private type As.

  • Methods as(T), nearest(T), convert_bare_type(T), convert_real_type(T), convert_floating_point_type(T), and convert_eltype(T) yield converters to type T.

  • Inference works for more than 3 arguments for bare_type(args...), real_type(args...), and floating_point_type(args...).