From 9888a94747412734daed405abc23c74c638b088a Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Sun, 10 Nov 2024 19:45:31 +0100 Subject: [PATCH] fix l1/z5 results --- l1/5.jl | 8 ++++---- l1/sprawozdanie.tex | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/l1/5.jl b/l1/5.jl index d716a78..e36cb86 100755 --- a/l1/5.jl +++ b/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) diff --git a/l1/sprawozdanie.tex b/l1/sprawozdanie.tex index ebfb415..454f398 100644 --- a/l1/sprawozdanie.tex +++ b/l1/sprawozdanie.tex @@ -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}