9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Charles Forsyth <charles.forsyth@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] IEEE floats
Date: Thu, 27 Feb 2014 12:29:18 +0000	[thread overview]
Message-ID: <CAOw7k5ivsaNu8wvMnAwpQreDm9HshHbbTgkhSifHNXRwEXzEnw@mail.gmail.com> (raw)
In-Reply-To: <817c1134cd276abf444e8f03633b63d4@mikro.quanstro.net>

[-- Attachment #1: Type: text/plain, Size: 624 bytes --]

On 27 February 2014 12:09, erik quanstrom <quanstro@quanstro.net> wrote:

> did they abolish the rule that float is promoted to double
> on function call?  or is this the equivalent of char fu(char) vs
> int fu(int).
>

if you use the original declaration syntax of 40 years ago,
float must be promoted to double because the caller won't know the type,
but the ANSI declarator syntax that everyone ought to be using allows
the distinction between float and double to be maintained, and it is.
compare

void
g(float a)
{
g(a);    /* a is float */
}

void
h(a)
float a;
{
h(a);    /* a is double */
}

[-- Attachment #2: Type: text/html, Size: 1690 bytes --]

  reply	other threads:[~2014-02-27 12:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-27 11:51 Steve Simon
2014-02-27 12:09 ` erik quanstrom
2014-02-27 12:29   ` Charles Forsyth [this message]
2014-02-27 12:45     ` erik quanstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOw7k5ivsaNu8wvMnAwpQreDm9HshHbbTgkhSifHNXRwEXzEnw@mail.gmail.com \
    --to=charles.forsyth@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).