Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Mar 2003 18:48:17 +0100
From:      Till Riedel <till@f111.hadiko.de>
To:        "Sergey A. Osokin" <osa@freebsd.org.ru>
Cc:        freebsd-current@freebsd.org
Subject:   Re: libm problem
Message-ID:  <20030318174817.GB2322@f111.hadiko.de>
In-Reply-To: <20030318173750.GF90099@freebsd.org.ru>
References:  <20030318173051.GA2322@f111.hadiko.de> <20030318173750.GF90099@freebsd.org.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Mar 18, 2003 at 08:37:50PM +0300, Sergey A. Osokin wrote:
> On Tue, Mar 18, 2003 at 06:30:51PM +0100, Till Riedel wrote:
> > Hi,
> > since installed a new world this weekend strange things happen to me:
> > 
> > {till@sabbath}-{~} $ cat test.c
> > #include "math.h"
> > 
> > int main()
> > {
> >   int base=8;
> >   int dim=2;
> >   float res;
> >   res=pow((float)base,(float)dim);
> >   printf("%f\n",res);
> >   return 0;
> > }
> > {till@sabbath}-{~} $ gcc -lm test.c
> > {till@sabbath}-{~} $ ./a.out
> > 1.000000
> > 
> > what happened to my libm???
> > on my 4.8 box the result is 64 by the way :-)
> > CPU: Pentium 4 (2411.60-MHz 686-class CPU)
> > Origin = "GenuineIntel"  Id = 0xf27  Stepping = 7
> > any suggestions?
> 
> Here is a patch for your program :-)
> 
> --- test.c.orig	Tue Mar 18 20:36:03 2003
> +++ test.c	Tue Mar 18 20:36:08 2003
> @@ -1,6 +1,7 @@
> -#include "math.h"
> +#include <stdio.h>
> +#include <math.h>
>  
> -int main()
> +int main(void)
>  {
>    int base=8;
>    int dim=2;
> -- 
supprisingly the problem persits after applying the patch :-)
learning to write nicer code,

till

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030318174817.GB2322>