Skip to content

Constant for machine precision #4

Description

@ivan-pi

The code below

pdecheb/pdecheb/inichb.f

Lines 268 to 279 in f429435

C
C CALCULATE ROUGH ESTIMATE OF UNIT ROUND-OFF ERROR FOR CHECKING
C
TWOU = 0.1D0
40 TEMP = 1.0D0 + TWOU
IF (1.0D0.EQ.TEMP) THEN
TWOU = TWOU*2.0D0
ELSE
TWOU = TWOU*0.5D0
GO TO 40
END IF
C

can be replaced with a call to the intrinsic function epsilon:

twou = epsilon(1.0D0)

This could also become a parameter instead of a dynamic variable in a common block.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions