Mail Archives: djgpp/1992/02/19/14:29:58
Some time ago I asked for help with the following problem.
I have not yet received a response. Perhaps someone new is
listening now! DJ Delorie wrote me a most gracious note,
but his suggestion failed to solve the problem.
The following program seems to work on a UNIX system, but not
on DOS with the DJ Delorie implementation of gcc. I would
very much like to know how to get it to work. The DOS is
3.3, the machine is a 386sx without a maths coprocessor.
The following is what happens on a UNIX system:
12:57:48> more testpow.c
#include <stdio.h>
#include <math.h>
main(){
double a,b,c;
a = 2.0;
b = 3.0;
c = pow(a, b);
printf("%f = pow(%f, %f)\n", c, a, b);
exit(0);
}
12:57:49> gcc -c testpow.c
gcc -o testpow 12:58:08> gcc -o testpow testpow.o -lm
12:58:18> ./testpow
8.000000 = pow(2.000000, 3.000000)
12:58:21>
The following happens on MS-DOS:
C:\WORK>set
COMSPEC=C:\COMMAND.COM
PROMPT=$P$G
PATH=W:.;X:.;Y:.;C:\GNU;C:\DOS;C:\TELNET;C:\KERMIT;Z:.
GCCBIN=m:\cc\bin
GCCINC=m:/cc/include
GCCLIB=m:/cc/lib
TEMP=c:
TZ=GMT0
GO32=ansi emu m:/cc/emu387/emu387 driver m:/cc/drivers/vga.grd gw 640 gh 480
BISON_SIMPLE=m:/cc/lib/bison.simple
BISON_HAIRY=m:/cc/lib/bison.hairy
FLEX_SKELETON=m:/cc/lib/flex.skeleton
C:\WORK>gcc -c testpow.c
C:\WORK>gcc -o testpow testpow.o -lm
C:\WORK>go32 testpow
w:/mccsoft/cc/bin/go32 Copyright (C) 1991 DJ Delorie
2.1087770 = pow(2.0000000, 3.0000000)
I would very much appreciate any help with this problem.
A. V. Le Blanc
University of Manchester
LeBlanc AT mcc DOT ac DOT uk
- Raw text -