89 integer,
parameter :: wp = kind(1.e0)
98 real(wp),
parameter :: zero = 0.0_wp
99 real(wp),
parameter :: one = 1.0_wp
100 real(wp),
parameter :: maxn = huge(0.0_wp)
103 real(wp),
parameter :: tsml = real(radix(0._wp), wp)**ceiling( &
104 (minexponent(0._wp) - 1) * 0.5_wp)
105 real(wp),
parameter :: tbig = real(radix(0._wp), wp)**floor( &
106 (maxexponent(0._wp) - digits(0._wp) + 1) * 0.5_wp)
107 real(wp),
parameter :: ssml = real(radix(0._wp), wp)**( - floor( &
108 (minexponent(0._wp) - digits(0._wp)) * 0.5_wp))
109 real(wp),
parameter :: sbig = real(radix(0._wp), wp)**( - ceiling( &
110 (maxexponent(0._wp) + digits(0._wp) - 1) * 0.5_wp))
121 real(wp) :: abig, amed, asml, ax, scl, sumsq, ymax, ymin
144 if( incx < 0 ) ix = 1 - (n-1)*incx
148 abig = abig + (ax*sbig)**2
150 else if (ax < tsml)
then
151 if (notbig) asml = asml + (ax*ssml)**2
161 if (abig > zero)
then
165 if ( (amed > zero) .or. (amed > maxn) .or. (amed /= amed) )
then
166 abig = abig + (amed*sbig)*sbig
170 else if (asml > zero)
then
174 if ( (amed > zero) .or. (amed > maxn) .or. (amed /= amed) )
then
176 asml = sqrt(asml) / ssml
177 if (asml > amed)
then
185 sumsq = ymax**2*( one + (ymin/ymax)**2 )
197 snrm2 = scl*sqrt( sumsq )
real(wp) function snrm2(n, x, incx)
SNRM2