Skip to content

Commit

Permalink
Merge pull request #350 from CliMA/ck/fix_nan_check
Browse files Browse the repository at this point in the history
Fix NaN check
  • Loading branch information
charleskawczynski authored Jan 18, 2025
2 parents 89f2558 + 4be96c2 commit 53a1690
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/src/dev/compute_convergence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ function compute_convergence!(
float_str(x) = @sprintf "%.4f" x
pow_str(x) = "10^{$(@sprintf "%.1f" log10(x))}"
function si_str(x)
x in (0, Inf, -Inf, NaN) && return string(x)
if isnan(x) || x in (0, Inf, -Inf)
return string(x)
end
exponent = floor(Int, log10(x))
mantissa = x / 10.0^exponent
return "$(float_str(mantissa)) \\times 10^{$exponent}"
Expand Down

0 comments on commit 53a1690

Please sign in to comment.