LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
integer function ieeeck ( integer  ISPEC,
real  ZERO,
real  ONE 
)

Definition at line 626 of file tstiee.f.

626 *
627 * -- LAPACK auxiliary routine (version 3.4.0) --
628 * Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
629 * November 2006
630 *
631 * .. Scalar Arguments ..
632  INTEGER ispec
633  REAL zero, one
634 * ..
635 *
636 * Purpose
637 * =======
638 *
639 * IEEECK is called from the ILAENV to verify that Inifinity and
640 * possibly NaN arithmetic is safe (i.e. will not trap).
641 *
642 * Arguments:
643 * ==========
644 *
645 * ISPEC (input) INTEGER
646 * Specifies whether to test just for inifinity arithmetic
647 * or whether to test for infinity and NaN arithmetic.
648 * = 0: Verify infinity arithmetic only.
649 * = 1: Verify infinity and NaN arithmetic.
650 *
651 * ZERO (input) REAL
652 * Must contain the value 0.0
653 * This is passed to prevent the compiler from optimizing
654 * away this code.
655 *
656 * ONE (input) REAL
657 * Must contain the value 1.0
658 * This is passed to prevent the compiler from optimizing
659 * away this code.
660 *
661 * RETURN VALUE: INTEGER
662 * = 0: Arithmetic failed to produce the correct answers
663 * = 1: Arithmetic produced the correct answers
664 *
665 * .. Local Scalars ..
666  REAL posinf, neginf, nan1, nan2, nan3, nan4, nan5, nan6, negzro,
667  $ newzro
668 * ..
669 * .. Executable Statements ..
670  ieeeck = 1
671 
672  posinf = one /zero
673  IF ( posinf .LE. one ) THEN
674  ieeeck = 0
675  RETURN
676  ENDIF
677 
678  neginf = -one / zero
679  IF ( neginf .GE. zero ) THEN
680  ieeeck = 0
681  RETURN
682  ENDIF
683 
684  negzro = one / ( neginf + one )
685  IF ( negzro .NE. zero ) THEN
686  ieeeck = 0
687  RETURN
688  ENDIF
689 
690  neginf = one / negzro
691  IF ( neginf .GE. zero ) THEN
692  ieeeck = 0
693  RETURN
694  ENDIF
695 
696  newzro = negzro + zero
697  IF ( newzro .NE. zero ) THEN
698  ieeeck = 0
699  RETURN
700  ENDIF
701 
702  posinf = one / newzro
703  IF ( posinf .LE. one ) THEN
704  ieeeck = 0
705  RETURN
706  ENDIF
707 
708  neginf = neginf * posinf
709  IF ( neginf .GE. zero ) THEN
710  ieeeck = 0
711  RETURN
712  ENDIF
713 
714  posinf = posinf * posinf
715  IF ( posinf .LE. one ) THEN
716  ieeeck = 0
717  RETURN
718  ENDIF
719 
720 
721 
722 *
723 * Return if we were only asked to check infinity arithmetic
724 *
725  IF (ispec .EQ. 0 ) RETURN
726 
727  nan1 = posinf + neginf
728 
729  nan2 = posinf / neginf
730 
731  nan3 = posinf / posinf
732 
733  nan4 = posinf * zero
734 
735  nan5 = neginf * negzro
736 
737  nan6 = nan5 * 0.0
738 
739  IF ( nan1 .EQ. nan1 ) THEN
740  ieeeck = 0
741  RETURN
742  ENDIF
743 
744  IF ( nan2 .EQ. nan2 ) THEN
745  ieeeck = 0
746  RETURN
747  ENDIF
748 
749  IF ( nan3 .EQ. nan3 ) THEN
750  ieeeck = 0
751  RETURN
752  ENDIF
753 
754  IF ( nan4 .EQ. nan4 ) THEN
755  ieeeck = 0
756  RETURN
757  ENDIF
758 
759  IF ( nan5 .EQ. nan5 ) THEN
760  ieeeck = 0
761  RETURN
762  ENDIF
763 
764  IF ( nan6 .EQ. nan6 ) THEN
765  ieeeck = 0
766  RETURN
767  ENDIF
768 
769  RETURN
integer function ieeeck(ISPEC, ZERO, ONE)
Definition: tstiee.f:626

Here is the caller graph for this function: