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


Groups > comp.lang.c > #15432

Re: casting constant value from float to unsigned short - compiler bugs?

From James Kuyper <jameskuyper@verizon.net>
Newsgroups comp.lang.c
Subject Re: casting constant value from float to unsigned short - compiler bugs?
Date 2012-01-04 19:12 -0500
Organization A noiseless patient Spider
Message-ID <4F04EB0B.60701@verizon.net> (permalink)
References (2 earlier) <jbbjsk$ja4$2@speranza.aioe.org> <f_ydnS3uiPzU7UTTnZ2dnUVZ8lqdnZ2d@giganews.com> <rubrum-5D58A3.12315703012012@news.albasani.net> <lnmxa45x6c.fsf@nuthaus.mib.org> <rubrum-8407B2.15141404012012@news.albasani.net>

Show all headers | View raw


On 01/04/2012 06:14 PM, Michael Press wrote:
> In article <lnmxa45x6c.fsf@nuthaus.mib.org>,
>  Keith Thompson <kst-u@mib.org> wrote:
> 
>> Michael Press <rubrum@pacbell.net> writes:
...
>>> The floor function is defined as
>>>
>>>     floor(x) = maximum integer m such that m <= x.
>>>
>>> Hence floor(x) <= x.
>>
>> Yes, and that's consistent with the C standard's floor(), floorf(),
>> and floorl() functions in <math.h>.
>>
>>> The fractional part of x is defined to be
>>>
>>>     frac(x) = x - floor(x).
>>>
>>> Hence frac(x) >= 0.
>>
>> Can you cite a source that says that that's what "fractional part"
>> means in mathematics?
> 
> Yes. Why? Do you have a source that states otherwise?

At the time Keith posted, Ben Pfaff had already given a URL for a
Mathematica web site indicating that "Spanier and Oldham (1987) use the
same definition as Mathematica", which is (probably not coincidentally)
the same as C's definition.

...
[snip 116 blank lines]
What was the purpose of those blank lines?

> Knuth, ACP, 1.2.4.
> 
> Oxford Dictionary of Mathematics
> <http://books.google.com/books?id=UTCenrlmVW4C&pg=PT192&lpg=PT192&dq=Dictionary+mathematics+fractional+part+-function&source=bl&ots=ezjia_b9uW&sig=Tojsd5nB2_gcZixDfGfB8SRVjAo&hl=en>

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


Thread

casting constant value from float to unsigned short - compiler bugs? "news.aon.at" <mario_semo@hotmail.com> - 2011-12-02 10:06 +0100
  Re: casting constant value from float to unsigned short - compiler bugs? jacob navia <jacob@spamsink.net> - 2011-12-02 10:34 +0100
    Re: casting constant value from float to unsigned short - compiler bugs? Vincenzo Mercuri <vincenzo.mercuri@hotmail.it> - 2011-12-02 18:10 +0100
    Re: casting constant value from float to unsigned short - compiler bugs? Quentin Pope <qp19433@hotmail.NOSPAM.com> - 2011-12-02 22:36 +0000
      Re: casting constant value from float to unsigned short - compiler bugs? jacob navia <jacob@spamsink.net> - 2011-12-03 00:45 +0100
        Re: casting constant value from float to unsigned short - compiler  bugs? pete <pfiland@mindspring.com> - 2011-12-02 19:43 -0500
          Re: casting constant value from float to unsigned short - compiler   bugs? pete <pfiland@mindspring.com> - 2011-12-02 19:49 -0500
        Re: casting constant value from float to unsigned short - compiler bugs? Vincenzo Mercuri <vincenzo.mercuri@yahoo.it> - 2011-12-03 01:51 +0100
          Re: casting constant value from float to unsigned short - compiler bugs? James Kuyper <jameskuyper@verizon.net> - 2011-12-03 11:51 -0500
            Re: casting constant value from float to unsigned short - compiler bugs? Vincenzo Mercuri <vincenzo.mercuri@hotmail.it> - 2011-12-03 19:08 +0100
              Re: casting constant value from float to unsigned short - compiler bugs? Quentin Pope <qp19433@hotmail.NOSPAM.com> - 2011-12-03 19:06 +0000
                Re: casting constant value from float to unsigned short - compiler bugs? Kaz Kylheku <kaz@kylheku.com> - 2011-12-03 19:14 +0000
                Re: casting constant value from float to unsigned short - compiler bugs? Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-12-04 17:19 +0200
                Re: casting constant value from float to unsigned short - compiler bugs? James Kuyper <jameskuyper@verizon.net> - 2011-12-04 10:39 -0500
      Re: casting constant value from float to unsigned short - compiler bugs? Vincenzo Mercuri <vincenzo.mercuri@yahoo.it> - 2011-12-03 01:41 +0100
        Re: casting constant value from float to unsigned short - compiler bugs? Michael Press <rubrum@pacbell.net> - 2012-01-03 12:31 -0800
          Re: casting constant value from float to unsigned short - compiler bugs? blp@cs.stanford.edu (Ben Pfaff) - 2012-01-03 12:38 -0800
            Re: casting constant value from float to unsigned short - compiler bugs? Michael Press <rubrum@pacbell.net> - 2012-01-06 11:38 -0800
              Re: casting constant value from float to unsigned short - compiler bugs? James Kuyper <jameskuyper@verizon.net> - 2012-01-06 15:10 -0500
          Re: casting constant value from float to unsigned short - compiler bugs? Keith Thompson <kst-u@mib.org> - 2012-01-03 12:49 -0800
            Re: casting constant value from float to unsigned short - compiler bugs? Michael Press <rubrum@pacbell.net> - 2012-01-04 15:14 -0800
              Re: casting constant value from float to unsigned short - compiler bugs? James Kuyper <jameskuyper@verizon.net> - 2012-01-04 19:12 -0500
                Re: casting constant value from float to unsigned short - compiler bugs? Michael Press <rubrum@pacbell.net> - 2012-01-04 23:04 -0800
                Re: casting constant value from float to unsigned short - compiler bugs? Keith Thompson <kst-u@mib.org> - 2012-01-05 02:43 -0800
                Re: casting constant value from float to unsigned short - compiler bugs? James Kuyper <jameskuyper@verizon.net> - 2012-01-05 07:14 -0500
                Re: casting constant value from float to unsigned short - compiler bugs? Michael Press <rubrum@pacbell.net> - 2012-01-06 11:39 -0800
                Re: casting constant value from float to unsigned short - compiler bugs? Michael Press <rubrum@pacbell.net> - 2012-01-05 16:14 -0800
                Re: casting constant value from float to unsigned short - compiler bugs? Keith Thompson <kst-u@mib.org> - 2012-01-05 16:44 -0800
                Re: casting constant value from float to unsigned short - compiler bugs? Michael Press <rubrum@pacbell.net> - 2012-01-06 11:30 -0800
                Re: casting constant value from float to unsigned short - compiler bugs? James Kuyper <jameskuyper@verizon.net> - 2012-01-06 15:24 -0500
                Re: casting constant value from float to unsigned short - compiler bugs? Tim Rentsch <txr@alumni.caltech.edu> - 2012-01-26 09:14 -0800
              Re: casting constant value from float to unsigned short - compiler bugs? gwowen <gwowen@gmail.com> - 2012-01-05 04:09 -0800
              Re: casting constant value from float to unsigned short - compiler bugs? "io_x" <a@b.c.invalid> - 2012-01-05 16:32 +0100
          Re: casting constant value from float to unsigned short - compiler bugs? Nobody <nobody@nowhere.com> - 2012-01-04 09:11 +0000
            Re: casting constant value from float to unsigned short - compiler bugs? Michael Press <rubrum@pacbell.net> - 2012-01-04 23:08 -0800
              Re: casting constant value from float to unsigned short - compiler bugs? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-01-05 11:15 +0000
                Re: casting constant value from float to unsigned short - compiler bugs? James Kuyper <jameskuyper@verizon.net> - 2012-01-05 07:27 -0500
                Re: casting constant value from float to unsigned short - compiler bugs? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-01-05 13:03 +0000
                Re: casting constant value from float to unsigned short - compiler bugs? Michael Press <rubrum@pacbell.net> - 2012-01-05 16:28 -0800
                Re: casting constant value from float to unsigned short - compiler bugs? James Kuyper <jameskuyper@verizon.net> - 2012-01-06 07:17 -0500
                Re: casting constant value from float to unsigned short - compiler bugs? lawrence.jones@siemens.com - 2012-01-06 12:04 -0500
                Re: casting constant value from float to unsigned short - compiler bugs? Tim Rentsch <txr@alumni.caltech.edu> - 2012-01-26 09:08 -0800
                Re: casting constant value from float to unsigned short - compiler bugs? Michael Press <rubrum@pacbell.net> - 2012-01-05 16:17 -0800
      Re: casting constant value from float to unsigned short - compiler bugs? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-12-03 01:50 +0000
  Re: casting constant value from float to unsigned short - compiler bugs? James Kuyper <jameskuyper@verizon.net> - 2011-12-02 06:41 -0500
    Re: casting constant value from float to unsigned short - compiler bugs? Vincenzo Mercuri <vincenzo.mercuri@hotmail.it> - 2011-12-02 16:26 +0100

csiph-web