https://github.com/tpapp/algebraresulttypes.jl
result type calculations for algebraic operations
https://github.com/tpapp/algebraresulttypes.jl
Last synced: 11 months ago
JSON representation
result type calculations for algebraic operations
- Host: GitHub
- URL: https://github.com/tpapp/algebraresulttypes.jl
- Owner: tpapp
- License: other
- Created: 2019-01-31T18:02:11.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-05-08T12:49:32.000Z (about 3 years ago)
- Last Synced: 2025-02-28T16:20:08.412Z (over 1 year ago)
- Language: Julia
- Size: 15.6 KB
- Stars: 2
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# AlgebraResultTypes.jl

[](https://github.com/tpapp/AlgebraResultTypes.jl/actions?query=workflow%3ACI)
[](http://codecov.io/github/tpapp/AlgebraResultTypes.jl?branch=master)
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
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.