delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/07/02/17:26:06

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <3B40E419.1050809@Interwoven.com>
Date: Mon, 02 Jul 2001 14:14:01 -0700
From: Sandeep Tamhankar <sandman AT Interwoven DOT com>
User-Agent: Mozilla/5.0 (X11; U; Linux 2.4.2-2 i686; en-US; rv:0.9) Gecko/20010507
X-Accept-Language: en
MIME-Version: 1.0
To: Marold Moosrainer <marold DOT moosrainer AT web DOT de>
CC: cygwin AT cygwin DOT com
Subject: Re: gcc floating point problem with scanf
References: <000d01c10185$3b753620$8c05f63e AT texas>
X-AntiVirus: scanned for viruses by Interwoven Virus scanner (http://www.interwoven.com)

I just tried compling and running your program with gcc 2.95.3-5 with 
Cygwin 1.3.2 on W2k Pentium III machine.  Works fine in that 
configuration.  Maybe upgrade your gcc?  Although I have to admit that 
such a basic error as this should not exist in any gcc, so there 
probably is something fundamentally wrong with your environment.

Good luck!

-Sandeep

Marold Moosrainer wrote:

> Dear cygwin team,
>
> I cannot correctly input floating point numbers via scanf. I am using 
> gcc 2.95.3-4 as it is distributed by cygnus solutions. My machine is a 
> Pentium Win98 computer. Please find attached the requested 
> cygcheck.out file and below a code snip for the problem. I would be 
> happy to get some ideas.
>
> Regards, Marold
>
> Command line:
>
> $ gcc scanf_float.c
>
> Source code:
>
> #include <stdio.h>
>
> int main(void)
> {
>       int i;
>       float flt;
>       double dbl;
>
>       printf("Enter int: ");     /* 55 */
>       scanf("%i", &i);
>       printf("i=%i\n", i);        /* 55, ok */
>      
>       printf("Enter float: ");     /* 5.543 */
>       scanf("%f", &flt);
>       printf("flt=%f\n", flt);    /* 5543.000000, ERROR */
>
>       printf("Enter double: ");      /* 5.543 */
>       scanf("%lf", &dbl);
>       printf("dbl=%f\n", dbl);    /* 5543.000000, ERROR */
>       
>       return 0;
> }
>
>
>------------------------------------------------------------------------
>
>--
>Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>Bug reporting:         http://cygwin.com/bugs.html
>Documentation:         http://cygwin.com/docs.html
>FAQ:                   http://cygwin.com/faq/
>
> cygcheck.out
>
> Content-Type:
>
> application/octet-stream
> Content-Encoding:
>
> quoted-printable
>
>
> ------------------------------------------------------------------------
> Part 1.3
>
> Content-Type:
>
> text/plain
>
>



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019