Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #24154

Re: floor()

From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: floor()
Date 2012-08-02 14:58 -0700
Organization None to speak of
Message-ID <lnmx2d0xec.fsf@nuthaus.mib.org> (permalink)
References <5019226f$0$3111$ba620e4c@news.skynet.be> <jvb80h$6pp$1@news.httrack.net> <50195010$0$3109$ba620e4c@news.skynet.be> <slrn3vfsk1ik77.bn.ike@sverige.freeshell.org> <slrnk1lapu.ph6.grahn+nntp@frailea.sa.invalid>

Show all headers | View raw


Jorgen Grahn <grahn+nntp@snipabacken.se> writes:
> On Wed, 2012-08-01, Ike Naar wrote:
>> On 2012-08-01, Andre <pas.mois@ailleur.be> wrote:
>>> I must have missed something as it compile Ok but result of floor(2.233) 
>>> is 0??
>>>
> ...
>>>    printf("%d\n\r",floor(2.2333));
>>
>> Type mismatch; floor returns a double, but the
>> "%d" format expects an integer.
>
> Might as well mention this: turn on more warnings from the compiler
> to avoid such errors. For gcc it's something like
>
>   -W -Wall -pedantic -ansi -g -O2

-W is better written as -Wextra

-g doesn't enable warnings; it produces information to be used by a
debugger.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
    Will write code for food.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

floor() Andre <pas.mois@ailleur.be> - 2012-08-01 14:34 +0200
  Re: floor() Xavier Roche <xroche@free.fr.NOSPAM.invalid> - 2012-08-01 14:38 +0200
    Re: floor() Andre <pas.mois@ailleur.be> - 2012-08-01 16:47 +0200
    Re: floor() Andre <pas.mois@ailleur.be> - 2012-08-01 17:49 +0200
      Re: floor() Ike Naar <ike@sverige.freeshell.org> - 2012-08-01 15:53 +0000
        Re: floor() falk@rahul.net (Edward A. Falk) - 2012-08-01 18:26 +0000
        Re: floor() Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-08-02 16:30 +0000
          Re: floor() Keith Thompson <kst-u@mib.org> - 2012-08-02 14:58 -0700
      Re: floor() "Heinrich Wolf" <invalid@invalid.invalid> - 2012-08-01 17:56 +0200
      Re: floor() Noob <root@127.0.0.1> - 2012-08-01 17:58 +0200
      Re: floor() Keith Thompson <kst-u@mib.org> - 2012-08-01 10:31 -0700
        Re: floor() Ben Pfaff <blp@cs.stanford.edu> - 2012-08-01 10:43 -0700
          Re: floor() James Kuyper <jameskuyper@verizon.net> - 2012-08-01 13:51 -0400
            Re: floor() Ben Pfaff <blp@cs.stanford.edu> - 2012-08-01 10:59 -0700
              Re: floor() Noob <root@127.0.0.1> - 2012-08-02 10:04 +0200
              Re: floor() Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-08-02 16:33 +0000
              Re: floor() Craig Franck <craiglfranck@gmail.com> - 2012-08-03 20:49 -0400
  Re: floor() Noob <root@127.0.0.1> - 2012-08-01 16:47 +0200
    Re: floor() Andre <pas.mois@ailleur.be> - 2012-08-01 16:48 +0200
  Re: floor() TheGunslinger <mikiesrunsbaal.sec@sbcglobal.net> - 2012-08-01 09:49 -0500
    Re: floor() Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-08-01 10:58 -0400
      Re: floor() TheGunslinger <mikiesrunsbaal.sec@sbcglobal.net> - 2012-08-01 10:02 -0500
        Re: floor() James Kuyper <jameskuyper@verizon.net> - 2012-08-01 11:10 -0400
        Re: floor() TheGunslinger <mikiesrunsbaal.sec@sbcglobal.net> - 2012-08-01 10:12 -0500
          Re: floor() pete <pfiland@mindspring.com> - 2012-08-01 12:04 -0400
          Re: floor() James Kuyper <jameskuyper@verizon.net> - 2012-08-01 12:04 -0400
          Re: floor() Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-08-01 13:07 -0400
          Re: floor() Craig Franck <craiglfranck@gmail.com> - 2012-08-03 21:11 -0400

csiph-web