[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference rusure::math

Title:Mathematics at DEC
Moderator:RUSURE::EDP
Created:Mon Feb 03 1986
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2083
Total number of notes:14613

241.0. "I hate to go off on a TANGENT" by NACHO::MCMENEMY () Mon Mar 18 1985 19:48

I'm not sure if this is the right place for this, but I thought I would wait for
a few responses before placing this in the RTL notes file.


Below are two programs than call both tand and mth$tand.  however, the

results are not what they should be..

	COULD SOMEONE, LOOK AT WHAT I AM DOING, TO SEE WHAT IS WRONG OR TO
	CONFIRM THAT I AM NUTS...


			THANKS,
				Mike Mc Menemy



$ TY TAN.FOR
	REAL*4 X,X1

C	THESE CALLS TO TAND OR MTH$TAND WORK FINE.

	DO A=35,45

	X = TAND(A)
	
	WRITE (5,10) X,A
10	FORMAT(1X,F10.4,' = TAND(',F6.2,')',/)

	ENDDO


	DO A=34,45

	X = MTH$TAND(A)
	WRITE (5,20) X,A
20	FORMAT(1X,F10.4,' = MTH$TAND(',F6.2,')',/)

	ENDDO

	END

$ RUN TAN
    0.7002 = TAND( 35.00)

    0.7265 = TAND( 36.00)

    0.7536 = TAND( 37.00)

    0.7813 = TAND( 38.00)

    0.8098 = TAND( 39.00)

    0.8391 = TAND( 40.00)

    0.8693 = TAND( 41.00)

    0.9004 = TAND( 42.00)

    0.9325 = TAND( 43.00)

    0.9657 = TAND( 44.00)

    1.0000 = TAND( 45.00)

    0.6745 = MTH$TAND( 34.00)

    0.7002 = MTH$TAND( 35.00)

    0.7265 = MTH$TAND( 36.00)

    0.7536 = MTH$TAND( 37.00)

    0.7813 = MTH$TAND( 38.00)

    0.8098 = MTH$TAND( 39.00)

    0.8391 = MTH$TAND( 40.00)

    0.8693 = MTH$TAND( 41.00)

    0.9004 = MTH$TAND( 42.00)

    0.9325 = MTH$TAND( 43.00)

    0.9657 = MTH$TAND( 44.00)

    1.0000 = MTH$TAND( 45.00)

$ TY TAN1.FOR
	REAL*4 X,X1

C	THE CALL TO MTH$TAND DOES NOT WORK FINE.

	DO A=34,45

	X = MTH$TAND(A)
	WRITE (5,20) X,A
20	FORMAT(1X,F20.8,' = MTH$TAND(',F6.2,')',/)


	ENDDO


	DO A=35,45

	X = TAND(A)
	
	WRITE (5,10) X,A
10	FORMAT(1X,F20.8,' = TAND(',F6.2,')',/)

	ENDDO


	END

$ RUN TAN1
-1399373824.00000000 = MTH$TAND( 34.00)

 1087193088.00000000 = MTH$TAND( 35.00)

  -21938120.00000000 = MTH$TAND( 36.00)

 -387170240.00000000 = MTH$TAND( 37.00)

   39206984.00000000 = MTH$TAND( 38.00)

 1308704896.00000000 = MTH$TAND( 39.00)

 -818134976.00000000 = MTH$TAND( 40.00)

-1986838400.00000000 = MTH$TAND( 41.00)

-2132656000.00000000 = MTH$TAND( 42.00)

-1185988480.00000000 = MTH$TAND( 43.00)

  929185920.00000000 = MTH$TAND( 44.00)

      16512.00000000 = MTH$TAND( 45.00)

          0.70020753 = TAND( 35.00)

          0.72654253 = TAND( 36.00)

          0.75355411 = TAND( 37.00)

          0.78128564 = TAND( 38.00)

          0.80978400 = TAND( 39.00)

          0.83909965 = TAND( 40.00)

          0.86928672 = TAND( 41.00)

          0.90040410 = TAND( 42.00)

          0.93251508 = TAND( 43.00)

          0.96568882 = TAND( 44.00)

          1.00000000 = TAND( 45.00)

$ !
$ !
$ ! ONE OBSERVATION IS MTH$TAND(45.0) = 16512.0
$ !
$ ! WELL, 16512 DOES REPRESENT 1. IN FLOATING POINT NOTATION.
T.RTitleUserPersonal
Name
DateLines
241.1LATOUR::AMARTINTue Mar 19 1985 08:2411
In the second program you don't declare the data type of the value that
MTH$TAND returns.  Since M is in the range I..N, it is assumed to be of
type integer.

In the first program, when TAND is called, it probably introduces an
auxilliary declaration of MTH$TAND (the math library implementation of
the Fortran TAND function?) which has the correct typing specified for it.

If you specify IMPLICIT NONE at the start of the programs, the compiler
would hopefully diagnose the situation.
				/AHM
241.2HARE::STANTue Mar 19 1985 11:575
Correct.  Put in a

	REAL MTH$TAND

to fix your problem.