A Julia package for calculating result types of arithmetic operations.
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.
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
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.