Skip to content

Conversation

@kimikage
Copy link
Collaborator

This prevents MethodError due to lexical replacement of implicit * by macros. (cf. #190 (comment))

julia> using CheckedArithmetic

julia> @checked 1N0f8
1.0N0f8

julia> julia> @checked 1N0f8 * 0.5N0f8 # binary op. `mul`s will be gradually supported.
ERROR: MethodError: no method matching checked_mul(::Normed{UInt8,8}, ::Normed{UInt8,8})

The constructors still check the input range by default.

@kimikage kimikage force-pushed the checked_suffix_mul branch from 7af64e8 to 9f889f6 Compare August 13, 2020 17:52
@codecov
Copy link

codecov bot commented Aug 13, 2020

Codecov Report

Merging #210 into master will increase coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #210      +/-   ##
==========================================
+ Coverage   88.24%   88.31%   +0.07%     
==========================================
  Files           6        6              
  Lines         485      488       +3     
==========================================
+ Hits          428      431       +3     
  Misses         57       57              
Impacted Files Coverage Δ
src/FixedPointNumbers.jl 84.52% <100.00%> (+0.28%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b7e2ae1...2a60c95. Read the comment docs.

This prevents MethodError due to lexical replacement of implicit `*` by macros.
The constructors still check the input range by default.
@kimikage kimikage force-pushed the checked_suffix_mul branch from 9f889f6 to 2a60c95 Compare August 15, 2020 07:19
@kimikage kimikage merged commit 5dcaf97 into JuliaMath:master Aug 15, 2020
@kimikage kimikage deleted the checked_suffix_mul branch August 15, 2020 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant