the `isone` predicate throws instead of returning `false`
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Start with the rawone and oneunit paths in src/fixed.jl and src/FixedPointNumbers.jl, then rerun the Julia 1.11.3 reproduction from the issue. Verify the isone(0.0Q0f15) behavior against the reported expectation. Done means the predicate returns false instead of throwing an ArgumentError.
Written by the indexing model from the issue text.
Description
julia> using FixedPointNumbers
julia> isone(0.0Q0f15)
ERROR: ArgumentError: Q0f15 is a 16-bit type representing 65536 values from -1.0 to 0.99997; cannot represent 1
Stacktrace:
[1] throw_converterror(::Type{Q0f15}, x::Int64)
@ FixedPointNumbers ~/.julia/packages/FixedPointNumbers/Dn4hv/src/FixedPointNumbers.jl:326
[2] rawone(::Type{Q0f15})
@ FixedPointNumbers ~/.julia/packages/FixedPointNumbers/Dn4hv/src/fixed.jl:41
[3] oneunit(::Type{Q0f15})
@ FixedPointNumbers ~/.julia/packages/FixedPointNumbers/Dn4hv/src/FixedPointNumbers.jl:108
[4] one(::Type{Q0f15})
@ FixedPointNumbers ~/.julia/packages/FixedPointNumbers/Dn4hv/src/FixedPointNumbers.jl:109
[5] one(x::Q0f15)
@ FixedPointNumbers ~/.julia/packages/FixedPointNumbers/Dn4hv/src/FixedPointNumbers.jl:222
[6] isone(x::Q0f15)
@ Base ./number.jl:62
[7] top-level scope
@ REPL[2]:1
julia> versioninfo()
Julia Version 1.11.3
Commit d63adeda50d (2025-01-21 19:42 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 8 × AMD Ryzen 3 5300U with Radeon Graphics
WORD_SIZE: 64
LLVM: libLLVM-16.0.6 (ORCJIT, znver2)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)
Environment:
JULIA_NUM_PRECOMPILE_TASKS = 4
JULIA_PKG_PRECOMPILE_AUTO = 0
(@v1.11) pkg> st FixedPointNumbers
Status `~/.julia/environments/v1.11/Project.toml`
[53c48c17] FixedPointNumbers v0.8.5
- Dominant language
- Julia
- Stars
- 95
- Forks
- 38
- Avg merge
- 13m
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from JuliaMath/FixedPointNumbers.jl
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
JuliaMath/FixedPointNumbers.jl#335 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 42/100
JuliaMath/FixedPointNumbers.jl#331 · 3 comments ·
-
needs comments
Difficulty 3/5 1-2 days Newbie friendliness 68/100
JuliaMath/FixedPointNumbers.jl#318 · 1 comment ·
-
add-on enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
JuliaMath/FixedPointNumbers.jl#311 · 3 comments ·
-
Constructors on GPU? Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
All issues in JuliaMath/FixedPointNumbers.jl
Similar issues
-
bug 🐞 distributed 🕸️
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
CliMA/Oceananigans.jl#6049 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
JuliaGPU/GPUArrays.jl#780 ·