At 15:41 09-12-98 -0800, you wrote:
>I have a program that gets a bus error when trying to compute the cosine
>of 21.26 degrees or 0.371057 radians. This is Z'3EBDFB30' in IEEE
>format.
>
>I write a little program to try to test whether this is a problem in
>the cosine, or somewhere else (maybe something is damaging the
>cosine routine):
>
>program temp
> real DIR, IDIR
> equivalence (DIR, IDIR)
> read (*,'(z11)') idir
> print "('DIR hex = ', z8,', DIR decimal =', f9.6)", dir, dir
> print *, 'COS(dir) =', cos(dir)
>end program temp
I corrected and modified the program as follows:
program temp
implicit NONE
real :: DIR
integer :: IDIR
equivalence (DIR, IDIR)
read (*,'(z8)') idir
print "(' DIR hex = ', z11.8 / 'IDIR decimal = ', I11 / &
& ' DIR decimal = ', f11.2, 1pe20.7)", idir, idir, dir, dir
print *, 'COS(dir) =', cos(dir)
end program temp
When I compile with Salford FTN95 and run this program and give it
7777777a
it produces the error message
Error: FORMAT/Data mismatch
This sounds like a bug in the compiler/run-time.
I also tried inputs of
78787878
00000000
Now the program runs OK
---
Meilleures Salutations,
Best Greetings,
/---
Jan van Oosterwijk
Computing Centre
Delft University of Technology
Postbus 354
2600 AJ Delft
Netherlands / Pays-Bas
Phone: +31 15 278 50 17
Fax: +31 15 278 37 87
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|