AlgebraResultTypes

LifecycleBuild Statuscodecov.io

A Julia package for calculating result types of arithmetic operations.

Motivation

A lot of Julia code contains some simple functions to calculate the result types of arithmetic operations. This package aims to be a well-tested centralized implementation of these.

The package is really lightweight and has no dependencies.

Usage

julia> using AlgebraResultTypes: result_field, result_ring # no exported symbols
julia> result_field(Float64, Int)
Float64
julia> result_field(Int, Int)
Float64
julia> result_ring(Int, Int)
Int
julia> result_field(Real)
Number # non-concrete fallback

How can you help

Add tests for other types, especially if defined in another package.

If the tests pass, please make a PR.

If they don't, please open an issue, or (ideally) make a PR that includes fixes.