[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: round() in glibc*2.3.3-31

Le dim 30/05/2004 Ã 07:24, Mark Fonnemann a Ãcrit :
> (snip)
> round returning
> junk data which i still maintain is something gcc should fix

I am not a very "competent" programmer but there is nothing wrong with
gcc or glibc.

Without prototype, round() is supposed to return an int and not a double
(as describe in K&R manual :-)).

The bug report you pointed is clear :
        Use warnings:
        pr13734.c:4: warning: return type defaults to `int'
        pr13734.c: In function `main':
        pr13734.c:5: warning: implicit declaration of function `round'

math.h :
        The file <bits/mathcalls.h> contains the prototypes for all the
        actual math functions.
bits/mathcalls.h :
        #ifdef __USE_ISOC99
        /* Round X to nearest integral value, rounding halfway cases away from
           zero.  */
        __MATHCALLX (round,, (_Mdouble_ __x), (__const__));

gcc have very useful warnings for competent and incompetent programmers.
Use -Wall for exemple (info gcc).

> i challenge you to a coding contest if you really feel the urge to
> prove yourself!


Have fun !

Attachment: signature.asc
Description: Ceci est une partie de message =?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e=2E?=

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]