🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: chile.comp.programacion
Article #3582

funcion round en C

#3582
From: joe
Date: Thu, 09 Dec 2004 17:47
36 lines
1407 bytes
Hola

Tengo el siguiente problema con la funcion round.
El programa.

/***** round.c *****/
#include <stdio.h>
#include <math.h>

int main ()
{
	double x = 1.234, y;
	y = round(x);
	printf("El valor redondeado de %f es %f.\n", x,y);
	return 0;
}
/***** end ****/
				
Compilacion:
$ gcc -o round -Wall -lm round.c
round.c: In function `main':
round.c:7: warning: implicit declaration of function `round'

* Ejecucion:
$ ./round
El valor redondeado de 1.234000 es -927530976.000000.

$ gcc --version
gcc (GCC) 3.3.5 (Debian 1:3.3.5-3)
[...]

No cacho que estoy haciendo mal... Alguna idea?

Saludos!
-- 
joe
Technical Details
Message-ID: <cpa338$p9o$1@news1.nivel5.cl>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!nntp-server.pubsub.com!news1.nivel5.cl!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 1593cb,45a58cbd8a22477a,start
X-Google-Attributes: gid1593cb,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!nntp-server.pubsub.com!news1.nivel5.cl!not-for-mail
From: joe <joe@anonymous.nu>
Newsgroups: chile.comp.programacion
Subject: funcion round en C
Date: Thu, 9 Dec 2004 17:47:22 +0000 (UTC)
Organization: Varios
Lines: 36
Message-ID: <cpa338$p9o$1@news1.nivel5.cl>
NNTP-Posting-Host: cm-vina3-151-114.cm.vtr.net
X-Trace: news1.nivel5.cl 1102614442 25912 200.104.151.114 (9 Dec 2004 17:47:22 GMT)
X-Complaints-To: news@news1.nivel5.cl
NNTP-Posting-Date: Thu, 9 Dec 2004 17:47:22 +0000 (UTC)
User-Agent: tin/1.7.6-20040906 ("Baleshare") (UNIX) (Linux/2.6.9-1-k7 (i686))