Mail Archives: cygwin/2003/11/27/10:56:01
------=_20031127165551_30206
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Hello,
Sorry, I forgot to say that I'm using the latest cygwin.
gcc version is 3.3.1.
I have tried again the little example and now it works.
But my main program which ends by these two lines.
I have cleaned my program and I attach it to this mail.
Your sincerely,
Yann COLLETTE
> On Thu, Nov 27, 2003 at 03:39:51PM +0100, ycollet AT freesurf DOT fr wrote:
>> Hello,
>>
>> I've tried this program under cygwin:
>>
>> #include <math.h>
>>
>> int main()
>> {
>> printf("%lf\n", pow(2,8));
>> return 0;
>> }
>>
>> This program returns 8 instead of 256.
>> I've tried pow(2.0,8), pow(2.0, 8.0), etc ... Seems to me that I've
>> found a bug ?
>
> Works for me with Cygwin 1.5.5 and recent developer snapshots. You
> didn't tell anything about the version you're using.
>
> Corinna
>
> --
> Corinna Vinschen Please, send mails regarding Cygwin
> to Cygwin Developer
> mailto:cygwin AT cygwin DOT com Red Hat, Inc.
>
> --
> Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
> Problem reports: http://cygwin.com/problems.html
> Documentation: http://cygwin.com/docs.html
> FAQ: http://cygwin.com/faq/
------=_20031127165551_30206
Content-Type: text/plain; name="ess.c"
Content-Disposition: attachment; filename="ess.c"
#define N 8
#define POW(A,B) (exp((double)(B)*log((double)(A))))
int main()
{
int i, j, Value, res;
int * Code;
Code = (int *)malloc(N*sizeof(int));
for(i=0; i<POW(2,N)+1; i++)
{
res = i;
/* conversion int -> binaire */
for(j=0; j<N; j++)
{
if (POW(2,j)<=res)
{
res -= POW(2,j);
Code[j] = 1;
} /* End If */
else
{
Code[j] = 0;
} /* End Else */
} /* End For j */
printf("%d %f\n", i, 1.2);
} /* End For i */
free(Code);
printf("\n\n%f\n", pow(2.0,8.0));
return 0;
}
------=_20031127165551_30206
Content-Type: text/plain; charset=us-ascii
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
------=_20031127165551_30206--
- Raw text -