Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constant for machine precision #4

Open
ivan-pi opened this issue Mar 7, 2023 · 0 comments
Open

Constant for machine precision #4

ivan-pi opened this issue Mar 7, 2023 · 0 comments

Comments

@ivan-pi
Copy link
Owner

ivan-pi commented Mar 7, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant