You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix InexactError on X86 by using explicit Int64 in rational literals
This PR fixes the `InexactError: Rational(0.8438818565400843)` that occurs when running DelayDiffEq.jl tests on X86 (32-bit) architectures.
## Problem Description
The error was occurring in DelayDiffEq.jl tests on X86 architecture with the following stack trace:
```
InexactError: Rational(0.8438818565400843)
at OrdinaryDiffEqBDF ~/.julia/packages/OrdinaryDiffEqBDF/T4s2z/src/bdf_perform_step.jl:904
```
## Root Cause
On X86 systems, `Int` becomes `Int32` instead of `Int64`. The issue occurred because:
1. Rational literals like `1 // j` create `Rational{Int}` types
2. On X86, this becomes `Rational{Int32}`
3. When combined with `Float64` values in BDF calculations, results couldn't be exactly represented as `Rational{Int32}`
4. This caused `InexactError` when Julia tried to convert the result back to `Rational{Int32}`
## Solution
Replace all hardcoded rational literals like `1 // j`, `2 // 3`, etc. with `Int64(1) // j`, `Int64(2) // 3` to ensure consistent `Rational{Int64}` types across all architectures.
## Files Changed
- `bdf_utils.jl`: Fixed γₖ constant definition
- `bdf_caches.jl`: Fixed cache initialization and BDF coefficient matrices
- `bdf_perform_step.jl`: Fixed multiple β₀, γ₁, γ₂ definitions and other rational literals
- `dae_perform_step.jl`: Fixed DAE-related rationals
- `dae_caches.jl`: Fixed DAE cache initialization and coefficient matrices
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
0 commit comments