delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/21/14:00:28

From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: qsort() bug? Or invalid usage???
Date: Fri, 21 Jan 2000 19:10:14 +0200
Organization: NetVision Israel
Lines: 21
Message-ID: <388892F6.80148238@is.elta.co.il>
References: <R0Gh4.2371$Ll5 DOT 3502 AT news2 DOT randori DOT com> <867gpd$k0u$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> <388758A7 DOT 1B64BDF9 AT cyberoptics DOT com> <388824A4 DOT 7E8CA268 AT is DOT elta DOT co DOT il> <869q6i$ika$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> <38887BFB DOT 2D3FA7A6 AT cyberoptics DOT com>
NNTP-Posting-Host: ras1-p37.rvt.netvision.net.il
Mime-Version: 1.0
X-Trace: news.netvision.net.il 948474610 5221 62.0.172.39 (21 Jan 2000 17:10:10 GMT)
X-Complaints-To: abuse AT netvision DOT net DOT il
NNTP-Posting-Date: 21 Jan 2000 17:10:10 GMT
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en,ru,hebrew
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Eric Rudd wrote:
> 
> #include <stdlib.h>
> int fltcmp(const void *a, const void *b) { /* Comparison based on */
>    double x, y;                            /* floating-point values */
>    int retval;
> 
>    x = atof((const char *) a);
>    y = atof((const char *) b);
>    retval = 0;
>    if (x > y) retval =  1;
>    if (x < y) retval = -1;
>    return retval;
> }
> 
> I will try it out with the new qsort, to see if the problems have been resolved.

If you still see problems, please report them.

You might also find the -mieee-fp option to GCC of interest in cases like the
above.

- Raw text -


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