Mail Archives: djgpp/1997/01/31/16:40:25
From: | frabb AT worldaccess DOT nl
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | square root
|
Date: | Fri, 31 Jan 97 19:18:29 GMT
|
Organization: | World Access
|
Lines: | 26
|
Message-ID: | <N.013197.201829.12@hrv2-5.worldaccess.nl>
|
NNTP-Posting-Host: | hrv2-5.worldaccess.nl
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
I am trying to compiloe this program:
/* find out about sqrt */
#include <stdio.h>
main()
{
long double dest, srce = 2.0;
dest = sqrt(srce);
printf("%.18Lf\n",dest);
asm ("fsqrt %1,%0" : "=f" (dest) : "f" (srce));
printf("%.18Lf\n",dest);
}
There is an error in the asm line, but I can't find it. And yes, I did try to
find it in Info, and in the faq.
The purpose of the program is to see if there is a difference in the two ways
to do sqrt. A call to sqrt() gives a double result. Using the hardware FPP
instruction fsqrt directly should produce a long double.
Maybe I should download the library sources, but 20:15 hours is a very bad time
to do so...
frank abbing.
- Raw text -