[Rd] Use d0 instead of _8 in ppr.f ?
Suharto Anggono Suharto Anggono
@uh@rto_@nggono @end|ng |rom y@hoo@com
Wed Apr 29 11:59:40 CEST 2026
SVN revision 89917 adds "_8" to some numbers in src/library/stats/src/ppr.f , with message
flang-22 wants explicit "double" / "8-bit float" constants
How about using "d0" instead? It is more consistent within the file and a little more portable. The number doesn't have to be equal to the number of bytes, 8.
Here is a patch that replaces "_8" with "d0".
--- ppr.f 2026-04-29 09:39:32.145702763 +0000
+++ ppr_d0.f 2026-04-29 09:39:32.268715531 +0000
@@ -842,9 +842,9 @@
data df, gcvpen, ismethod, trace /4d0, 1d0, 0, .false./
data ifl,maxit, conv, mitone, cutmin, fdel
- & / 6, 20, .005_8, 20, 0.1_8, 0.02_8 /
+ & / 6, 20, .005d0, 20, 0.1d0, 0.02d0 /
data span,alpha, big, cjeps, mitcj, lf
- & / 0.0, 0.0, 1.0e20, 0.001_8, 1, 2 /
+ & / 0.0, 0.0, 1.0e20, 0.001d0, 1, 2 /
end
subroutine setppr(span1, alpha1, optlevel, ism, df1, gcvpen1)
@@ -1259,7 +1259,7 @@
common /spans/ spans /consts/ big,sml,eps
data spans, big, sml, eps
- & /0.05_8, 0.2_8, 0.5, 1.0e20,1.0e-7,1.0e-3/
+ & /0.05d0, 0.2d0, 0.5, 1.0e20,1.0e-7,1.0e-3/
end
c---------------------------------------------------------------
c
@@ -1384,7 +1384,7 @@
c tol for 'spar' estimation:
param(3) = 1d-2
c 'eps' (~= 2^-12 = sqrt(2^-24) ?= sqrt(machine eps)) in ./sbart.c :
- param(4) = .000244_8
+ param(4) = .000244d0
ier = 1
call rbart(gcvpen,df1,dx,dy,dw,0.0d0,n,knot,nk,coef,dsmo,lev,
This is an alternative that uses "d" for all "double precision".
--- ppr.f 2026-04-29 09:39:32.145702763 +0000
+++ ppr_d0_all.f 2026-04-29 09:39:32.291717918 +0000
@@ -842,9 +842,9 @@
data df, gcvpen, ismethod, trace /4d0, 1d0, 0, .false./
data ifl,maxit, conv, mitone, cutmin, fdel
- & / 6, 20, .005_8, 20, 0.1_8, 0.02_8 /
+ & / 6, 20, .005d0, 20, 0.1d0, 0.02d0 /
data span,alpha, big, cjeps, mitcj, lf
- & / 0.0, 0.0, 1.0e20, 0.001_8, 1, 2 /
+ & / 0d0, 0d0, 1.0d20, 0.001d0, 1, 2 /
end
subroutine setppr(span1, alpha1, optlevel, ism, df1, gcvpen1)
@@ -1258,8 +1258,8 @@
double precision spans(3), big,sml,eps
common /spans/ spans /consts/ big,sml,eps
- data spans, big, sml, eps
- & /0.05_8, 0.2_8, 0.5, 1.0e20,1.0e-7,1.0e-3/
+ data spans, big, sml, eps
+ & /0.05d0, 0.2d0, 0.5d0, 1.0d20,1.0d-7,1.0d-3/
end
c---------------------------------------------------------------
c
@@ -1384,7 +1384,7 @@
c tol for 'spar' estimation:
param(3) = 1d-2
c 'eps' (~= 2^-12 = sqrt(2^-24) ?= sqrt(machine eps)) in ./sbart.c :
- param(4) = .000244_8
+ param(4) = .000244d0
ier = 1
call rbart(gcvpen,df1,dx,dy,dw,0.0d0,n,knot,nk,coef,dsmo,lev,
More information about the R-devel
mailing list