Silverfrost Forums

Welcome to our forums

Possible Bug: Spacing(X) at X=tiny(X)

18 Aug 2026 21:35GMT #33471

The following program should print the first five successive floating-point values obtained by starting at zero and repeatedly adding SPACING(x) to x.

program p
implicit none
real*8 :: x
integer :: i
x = 0.d0
do i = 1, 5
  print'(G0,2X,G0)', i, x
  x = x + spacing(x)
end do
end program p

The actual print out is not as I expected:

1  0.000000000000000
2  .2225073858507201E-307
3  -.1596672247627775E+294
4  -.1596672247627775E+294
5  -.1596672247627775E+294

X(2) is TINY(0.0), which looks correct, but X(3) = TINY(0.0) + SPACING(TINY(0.0)) is incorrect.

X(3) should be approximately 2 × TINY(0.0)

Am I misunderstanding something here (i.e. I am confused) or is this a bug?

19 Aug 2026 06:43GMT #33472

Ken

Thank you for the feedback. This looks like something that needs fixing.

7 Oct 2026 08:13GMT #33597

This has now been fixed for the next release of ClearWin64.dll.

Please login to reply.