This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problems VPATH, pow


Davies, Daniel wrote:
Sorry for the subject-less message - I hit the send button too soon.

-----Original Message-----
From: Davies, Daniel Sent: Monday, August 29, 2005 1:57 PM
To: 'newlib@sources.redhat.com'
Cc: Davies, Daniel
Subject:


First, let me thank everyone involved with newlib, it has certainly made
my life easier!
I'm cross compiling newlib 1.13.0 for powerpc-unknown-eabialtivec on
i386-pc-solaris2.10. I'm using version 3.80 of gnu make and gcc 4.0.1.
Two nits:
1. This is probably a solairs-ism. The VPATH declaration in
newlib-1.13.0/libgloss/rs6000/Makefile.in is
VPATH = @srcdir@ @srcdir@/..
This does not work in Solairs.
VPATH = @srcdir@:@srcdir@/..
(replaced space with colon) works.

I have changed this over to use colon as gnu make accepts either space or colon.


2. pow(0, y) = 1 for all y > 0, e.g. 0^2 = 1.  It looks like pow doesn't
check for this case, takes the log of 0 (which is undefined), gets a
number very close to 0 instead of an approximation to minus infinity,
later takes exp of this number and gets 1.


Can you provide a test that demonstrates your problem? I have a simple test which when run on mn10300 and linux, works as expected (result of
pow (0,2) is 0).


#include <stdio.h>
#include <math.h>

int main (void)
{
  printf ("pow (1,2) is %g\n", pow (1, 2));
  printf ("pow (0,2) is %g\n", pow (0, 2));
  printf ("pow (2,2) is %g\n", pow (2, 2));
  return 0;
}
~
bash-3.00$ ./a.out
pow (1,2) is 1
pow (0,2) is 0
pow (2,2) is 4


Dan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]