<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-2" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Howdy!<br>
<br>
Evo začetek man strani od round na moji mašini:<br>
<br>
<font color="#990000">NAME<br>
       round, roundf, roundl - round to nearest integer, away from zero<br>
<br>
SYNOPSIS<br>
       #include &lt;math.h&gt;<br>
<br>
       double round(double x);<br>
       float roundf(float x);<br>
       long double roundl(long double x);<br>
<br>
       Compile with -std=c99; link with -lm.</font><br>
<br>
Zlasti zadnja vrstica je pomenljiva:<br>
<br>
<font color="#000099">$ gcc -Wall -o test test.c<br>
test.c: In function &#8216;main&#8217;:<br>
test.c:6: warning: implicit declaration of function &#8216;round&#8217;<br>
test.c:6: warning: incompatible implicit declaration of built-in
function &#8216;round&#8217;</font><br>
<br>
med tem ko pri<br>
<br>
<font color="#000099">$ gcc -Wall -std=c99 -o test test.c</font><br>
<br>
ne javi ničesar ...<br>
<br>
$ gcc --version<br>
gcc (GCC) 4.1.2 20060901 (prerelease) (Debian 4.1.1-13)<br>
Copyright (C) 2006 Free Software Foundation, Inc.<br>
This is free software; see the source for copying conditions.  There is
NO<br>
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.<br>
<br>
<pre>Peace!
  Mkx

-- perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'
-- echo 16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlb xq | dc
</pre>
<hr>
<pre>It were not best that we should all think alike; it is difference of opinion
that makes horse-races.
                -- Mark Twain, "Pudd'nhead Wilson's Calendar"</pre>
<br>
<br>
Miha Tomšič wrote:
<blockquote
 cite="midd790bfa50612041127t5494998bn8e1df5e15a85360d@mail.gmail.com"
 type="cite">Hojla!
  <br>
  <br>
Imam en problem in kup težav.
  <br>
  <br>
Vzemimo test.c:
  <br>
----------------
  <br>
#include &lt;math.h&gt;
  <br>
#include &lt;stdio.h&gt;
  <br>
  <br>
int main(void)
  <br>
{
  <br>
       printf("%f, %f\n", 5.6, round(5.6));
  <br>
       return 0;
  <br>
}
  <br>
-----------------
  <br>
  <br>
[pingo@localhost ~]$ gcc test.c -o test
  <br>
test.c: In function 'main':
  <br>
test.c:6: warning: incompatible implicit declaration of built-in
  <br>
function 'round'
  <br>
[pingo@localhost ~]$ ./test
  <br>
5.600000, 6.000000
  <br>
  <br>
Vse lepo in prav, če zanemarimo zgornje opozorilo. -lm ni potreben,
  <br>
ker uporabi kar vgrajeno funkcijo round().
  <br>
  <br>
[pingo@localhost ~]$ gcc test.c -o test -fno-builtin -lm
  <br>
[pingo@localhost ~]$ ./test
  <br>
5.600000, 76941697922011962845100419780797605609472.000000
  <br>
  <br>
[pingo@localhost ~]$ gcc --version
  <br>
gcc (GCC) 4.1.1 20061011 (Red Hat 4.1.1-30)
  <br>
  <br>
---------------------
  <br>
  <br>
Saj mogoče sem jaz malo usekan, ampak zadeva je podobno bizarna tudi
  <br>
na drugi mašini:
  <br>
# gcc test.c -o test -lm
  <br>
# ./test
  <br>
5.600000, -0.000000
  <br>
# gcc --version
  <br>
2.95.4
  <br>
  <br>
A kdo vidi kje kakšno očitno napako? Problem se pojavlja še pri drugih
  <br>
matematičnih funkcijah (recimo sqrt()).
  <br>
  <br>
Hvala in srečno, Miha
  <br>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
lugos-prog mailing list
<a class="moz-txt-link-abbreviated" href="mailto:lugos-prog@lugos.si">lugos-prog@lugos.si</a>
<a class="moz-txt-link-freetext" href="http://liste2.lugos.si/cgi-bin/mailman/listinfo/lugos-prog">http://liste2.lugos.si/cgi-bin/mailman/listinfo/lugos-prog</a>
  </pre>
</blockquote>
<br>
<br>
</body>
</html>