1 |
C $Header:$ |
2 |
#include "CPP_EEOPTIONS.h" |
3 |
|
4 |
CStartofinterface |
5 |
LOGICAL FUNCTION DIFFERENT_MULTIPLE( freq, val1, val2 ) |
6 |
C /==========================================================\ |
7 |
C | LOGICAL FUNCTION DIFFERENT_MULTIPLE | |
8 |
C | o Checks two numbers multiple of a third number. | |
9 |
C |==========================================================| |
10 |
C | This routine is used for diagnostic and other periodic | |
11 |
C | operations. It is very sensitive to arithmetic precision.| |
12 |
C | For IEEE conforming arithmetic is works well but for | |
13 |
C | cases where short cut arithmetic is used it may not work| |
14 |
C | as expected. To overcome this issue compile this routine | |
15 |
C | separately with no optimisation. | |
16 |
C \==========================================================/ |
17 |
IMPLICIT NONE |
18 |
C Returns TRUE if val1 and val2 are different multiples of freq. |
19 |
REAL freq, val1, val2 |
20 |
CEndofinterface |
21 |
DIFFERENT_MULTIPLE = .FALSE. |
22 |
IF ( freq .EQ. 0. ) THEN |
23 |
DIFFERENT_MULTIPLE = .FALSE. |
24 |
ELSE |
25 |
DIFFERENT_MULTIPLE = INT(val1/freq) .NE. INT(val2/freq) |
26 |
ENDIF |
27 |
END |
28 |
|
29 |
|