fix l1/z5 results
This commit is contained in:
parent
b699603796
commit
9888a94747
2 changed files with 8 additions and 8 deletions
8
l1/5.jl
8
l1/5.jl
|
@ -61,10 +61,10 @@ function sumvectorsdecreasing(x::Vector{T}, y::Vector{T})::T where T <: Abstract
|
|||
s[i] = x[i] * y[i]
|
||||
end
|
||||
|
||||
spos::Vector{T} = s[s .> 0]
|
||||
spos::Vector{T} = s[s .> zero(T)]
|
||||
sort!(spos, rev = true)
|
||||
|
||||
sneg::Vector{T} = s[s .<= 0]
|
||||
sneg::Vector{T} = s[s .<= zero(T)]
|
||||
sort!(sneg)
|
||||
|
||||
neg::T = zero(T)
|
||||
|
@ -99,10 +99,10 @@ function sumvectorsincreasing(x::Vector{T}, y::Vector{T})::T where T <: Abstract
|
|||
s[i] = x[i] * y[i]
|
||||
end
|
||||
|
||||
spos::Vector{T} = s[s .> 0]
|
||||
spos::Vector{T} = s[s .> zero(T)]
|
||||
sort!(spos)
|
||||
|
||||
sneg::Vector{T} = s[s .<= 0]
|
||||
sneg::Vector{T} = s[s .<= zero(T)]
|
||||
sort!(sneg, rev = true)
|
||||
|
||||
neg::T = zero(T)
|
||||
|
|
|
@ -340,10 +340,10 @@ za pomocą powyższych czterech sposobów:
|
|||
\begin{tabular}{|c|c|c|}
|
||||
\hline
|
||||
Sposób & Wynik dla $Float32$ & Wynik dla $Float64$ \\ \hline
|
||||
(a) & -0.3472038161853561 & 1.0251881368296672e-10 \\
|
||||
(b) & -0.3472038162872195 & -1.5643308870494366e-10 \\
|
||||
(c) & -0.3472038162872195 & 0.0 \\
|
||||
(d) & -0.3472038162872195 & 0.0 \\
|
||||
(a) & -0.4999442994594574 & 1.0251881368296672e-10 \\
|
||||
(b) & -0.454345703125 & -1.5643308870494366e-10 \\
|
||||
(c) & -0.5 & 0.0 \\
|
||||
(d) & -0.5 & 0.0 \\
|
||||
\hline
|
||||
\end{tabular}
|
||||
\end{adjustbox}
|
||||
|
|
Loading…
Reference in a new issue