https://github.com/brainandforce/signtype.jl
Provides a type representing a sign.
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (8.8%) to scientific vocabulary
Repository
Provides a type representing a sign.
Basic Info
- Host: GitHub
- Owner: brainandforce
- License: mit
- Language: Julia
- Default Branch: main
- Size: 42 KB
Statistics
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 3
- Releases: 1
Metadata Files
README.md
SignType.jl
This package provides the Sign type, which represents the sign bit of a signed integer or float.
While the data stored by Sign is identical to that of Bool, the arithmetic semantics are defined
to match the behaviors of the real numbers +1 and -1. The logical semantics of Sign match
those of the underlying Boolean representation.
Construction
A Sign can be constructed from a Real number, extracting its signbit and converting it to a
Sign through reinterpretation: Sign(x::Real) = reinterpret(Sign, signbit(x)). For any custom
numeric type that uses a different convention to represent sign, this method should be defined for
that type.
The + and - operators are also accepted as arguments, resulting in the canonical printed
representations Sign(+) or Sign(-).
Calling Sign with a Bool, Unsigned, or any other type which cannot represent negative numbers
always returns Sign(+). Use reinterpret(::Type{Bool}, ::Sign) to treat a Sign as a Bool.
Zero elements and NaNs
Zero elements are treated specially, since Sign cannot represent zero:
* Calling the Sign constructor on a zero element returns the Sign that would be constructed
for the signbit.
* Calling convert(Sign, x) for a zero element x fails with an InexactError.
* zero(::Sign) returns false.
Construction or conversion from NaN values always throws an InexactError.
Arithmetic
All arithmetic operations defined on Integer are defined on Sign. Like Bool, addition or
subtraction of Sign instances (or Sign and Bool instances) results in an Int.
Rational division of Sign instances returns a Sign, as Rational{Sign} can only represent the
exact same range of values as Sign.
Logic
The logical operations defined on Sign treat Sign(+) and Sign(-) as their reinterpreted
Boolean values false and true, respectively.
Other number systems
Sign construction will fail on elements of unordered fields, such as Complex instances. However,
it may still work if the value of the input is a real number.
Owner
- Name: Brandon Flores
- Login: brainandforce
- Kind: user
- Location: Madison, WI
- Repositories: 7
- Profile: https://github.com/brainandforce
Chemist in the Fredrickson Group at UW-Madison
GitHub Events
Total
- Create event: 3
- Commit comment event: 3
- Issues event: 3
- Watch event: 5
- Issue comment event: 9
- Push event: 14
- Pull request event: 4
Last Year
- Create event: 3
- Commit comment event: 3
- Issues event: 3
- Watch event: 5
- Issue comment event: 9
- Push event: 14
- Pull request event: 4
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 3
- Total pull requests: 2
- Average time to close issues: about 2 months
- Average time to close pull requests: 8 minutes
- Total issue authors: 2
- Total pull request authors: 2
- Average comments per issue: 0.33
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 3
- Pull requests: 2
- Average time to close issues: about 2 months
- Average time to close pull requests: 8 minutes
- Issue authors: 2
- Pull request authors: 2
- Average comments per issue: 0.33
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- brainandforce (3)
- JuliaTagBot (1)
Pull Request Authors
- quildtide (1)
- brainandforce (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- julia 1 total
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 2
juliahub.com: SignType
Provides a type representing a sign.
- Documentation: https://docs.juliahub.com/General/SignType/stable/
- License: MIT
-
Latest release: 0.1.1
published 11 months ago
Rankings
Dependencies
- actions/checkout v3 composite
- codecov/codecov-action v4 composite
- julia-actions/cache v1 composite
- julia-actions/julia-buildpkg v1 composite
- julia-actions/julia-processcoverage v1 composite
- julia-actions/julia-runtest v1 composite
- julia-actions/setup-julia v1 composite
- JuliaRegistries/TagBot v1 composite