GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
pchst.f
Go to the documentation of this file.
1*DECK PCHST
2 REAL function pchst (arg1, arg2)
3C***BEGIN PROLOGUE PCHST
4C***SUBSIDIARY
5C***PURPOSE PCHIP Sign-Testing Routine
6C***LIBRARY SLATEC (PCHIP)
7C***TYPE SINGLE PRECISION (PCHST-S, DPCHST-D)
8C***AUTHOR Fritsch, F. N., (LLNL)
9C***DESCRIPTION
10C
11C PCHST: PCHIP Sign-Testing Routine.
12C
13C Returns:
14C -1. if ARG1 and ARG2 are of opposite sign.
15C 0. if either argument is zero.
16C +1. if ARG1 and ARG2 are of the same sign.
17C
18C The object is to do this without multiplying ARG1*ARG2, to avoid
19C possible over/underflow problems.
20C
21C Fortran intrinsics used: SIGN.
22C
23C***SEE ALSO PCHCE, PCHCI, PCHCS, PCHIM
24C***ROUTINES CALLED (NONE)
25C***REVISION HISTORY (YYMMDD)
26C 811103 DATE WRITTEN
27C 820805 Converted to SLATEC library version.
28C 870813 Minor cosmetic changes.
29C 890411 Added SAVE statements (Vers. 3.2).
30C 890411 REVISION DATE from Version 3.2
31C 891214 Prologue converted to Version 4.0 format. (BAB)
32C 900328 Added TYPE section. (WRB)
33C 910408 Updated AUTHOR and DATE WRITTEN sections in prologue. (WRB)
34C 930503 Improved purpose. (FNF)
35C***END PROLOGUE PCHST
36C
37C**End
38C
39C DECLARE ARGUMENTS.
40C
41 REAL arg1, arg2
42C
43C DECLARE LOCAL VARIABLES.
44C
45 REAL one, zero
46 SAVE zero, one
47 DATA zero /0./, one /1./
48C
49C PERFORM THE TEST.
50C
51C***FIRST EXECUTABLE STATEMENT PCHST
52 pchst = sign(one,arg1) * sign(one,arg2)
53 IF ((arg1.EQ.zero) .OR. (arg2.EQ.zero)) pchst = zero
54C
55 RETURN
56C------------- LAST LINE OF PCHST FOLLOWS ------------------------------
57 END
real function pchst(arg1, arg2)
Definition pchst.f:3