diff --git a/src/stdlib_stats_moment.fypp b/src/stdlib_stats_moment.fypp index 2d1cd23ee..ab1b77a5d 100644 --- a/src/stdlib_stats_moment.fypp +++ b/src/stdlib_stats_moment.fypp @@ -28,7 +28,7 @@ contains return end if - n = size(x, kind = int64) + n = real(size(x, kind = int64), ${k1}$) if (present(center)) then res = sum((x - center)**order) / n @@ -58,7 +58,7 @@ contains return end if - n = size(x, kind = int64) + n = real(size(x, kind = int64), dp) if (present(center)) then res = sum((real(x, dp) - center)**order) / n @@ -118,7 +118,7 @@ contains return end if - n = size(x, dim) + n = real(size(x, dim), ${k1}$) res = 0 select case(dim) @@ -193,7 +193,7 @@ contains return end if - n = size(x, dim) + n = real(size(x, dim), dp) res = 0 select case(dim) @@ -234,7 +234,7 @@ contains real(${k1}$) :: n - n = count(mask, kind = int64) + n = real(count(mask, kind = int64), ${k1}$) if (present(center)) then res = sum((x - center)**order, mask) / n @@ -259,7 +259,7 @@ contains real(dp) :: n - n = count(mask, kind = int64) + n = real(count(mask, kind = int64), dp) if (present(center)) then res = sum((real(x, dp) - center)**order, mask) / n @@ -309,7 +309,7 @@ contains real(${k1}$) :: n${reduced_shape('x', rank, 'dim')}$ ${t1}$, allocatable :: mean_${ranksuffix(rank-1)}$ - n = count(mask, dim) + n = real(count(mask, dim), ${k1}$) res = 0 select case(dim) @@ -387,7 +387,7 @@ contains real(dp) :: n${reduced_shape('x', rank, 'dim')}$ real(dp), allocatable :: mean_${ranksuffix(rank-1)}$ - n = count(mask, dim) + n = real(count(mask, dim), dp) res = 0 select case(dim) diff --git a/src/stdlib_stats_var.fypp b/src/stdlib_stats_var.fypp index 8461f11f6..31eaf243e 100644 --- a/src/stdlib_stats_var.fypp +++ b/src/stdlib_stats_var.fypp @@ -27,7 +27,7 @@ contains return end if - n = size(x, kind = int64) + n = real(size(x, kind = int64), ${k1}$) mean = sum(x) / n #:if t1[0] == 'r' @@ -57,7 +57,7 @@ contains return end if - n = size(x, kind = int64) + n = real(size(x, kind = int64), dp) mean = sum(real(x, dp)) / n res = sum((real(x, dp) - mean)**2) / (n - merge(1, 0, optval(corrected, .true.))) @@ -161,7 +161,7 @@ contains real(${k1}$) :: n ${t1}$ :: mean - n = count(mask, kind = int64) + n = real(count(mask, kind = int64), ${k1}$) mean = sum(x, mask) / n #:if t1[0] == 'r' @@ -187,7 +187,7 @@ contains real(dp) :: n, mean - n = count(mask, kind = int64) + n = real(count(mask, kind = int64), dp) mean = sum(real(x, dp), mask) / n res = sum((real(x, dp) - mean)**2, mask) / (n -& diff --git a/src/tests/stats/test_corr.f90 b/src/tests/stats/test_corr.f90 index c100a7af2..497b71136 100644 --- a/src/tests/stats/test_corr.f90 +++ b/src/tests/stats/test_corr.f90 @@ -233,7 +233,7 @@ subroutine test_int64(x, x2) , 'int64 check 1') call check( ieee_is_nan(corr(x, 1, .false.))& , 'int64 check 2') - call check( ieee_is_nan(corr(x, 1, x == 1.)), 'int64 check 3') + call check( ieee_is_nan(corr(x, 1, x == 1)), 'int64 check 3') call check( abs(corr(x, 1, x < 5) - 1._dp) < dptol, 'int64 check 4') call check( ieee_is_nan(corr(x, 1, x < -999)), 'int64 check 5') diff --git a/src/tests/stats/test_mean_f03.f90 b/src/tests/stats/test_mean_f03.f90 index 91083b414..fc90c4eaf 100644 --- a/src/tests/stats/test_mean_f03.f90 +++ b/src/tests/stats/test_mean_f03.f90 @@ -1,6 +1,6 @@ program test_mean use stdlib_error, only: check -use stdlib_kinds, only: sp, dp, int32, int64 +use stdlib_kinds, only: sp, dp, int32 use stdlib_io, only: loadtxt use stdlib_stats, only: mean implicit none diff --git a/src/tests/stats/test_rawmoment.f90 b/src/tests/stats/test_rawmoment.f90 index 46225c4e5..d20eef307 100644 --- a/src/tests/stats/test_rawmoment.f90 +++ b/src/tests/stats/test_rawmoment.f90 @@ -1,6 +1,6 @@ program test_rawmoment use stdlib_error, only: check - use stdlib_kinds, only: sp, dp, int32, int64 + use stdlib_kinds, only: sp, dp, int32 use stdlib_stats, only: mean, moment use,intrinsic :: ieee_arithmetic, only : ieee_is_nan implicit none diff --git a/src/tests/stats/test_varn.f90 b/src/tests/stats/test_varn.f90 index 041a26146..cee4e8468 100644 --- a/src/tests/stats/test_varn.f90 +++ b/src/tests/stats/test_varn.f90 @@ -1,6 +1,6 @@ program test_varn use stdlib_error, only: check - use stdlib_kinds, only: sp, dp, int32, int64 + use stdlib_kinds, only: sp, dp, int32 use stdlib_stats, only: var use,intrinsic :: ieee_arithmetic, only : ieee_is_nan implicit none