public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Dirk Uys" <dirkcuys@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] package.keywords syntax?
Date: Thu, 30 Oct 2008 12:46:44 +0200	[thread overview]
Message-ID: <79e3aefb0810300346m19d36196x4f3ec748f6a14be3@mail.gmail.com> (raw)
In-Reply-To: <38af3d670810291313p7937d68ei55d2b6ff9b9df6ad@mail.gmail.com>

On Wed, Oct 29, 2008 at 10:13 PM, Jorge Peixoto de Morais Neto
<please.no.spam.here@gmail.com> wrote:
> The real problem is when you type
> float real_number = 4e10;
> int integer = real_number;
> If your integer can only hold values up to 2^31 - 1 , the behavior of
> the above code is undefined.
> In a language like Python, everything either behaves as you intended,
> of throws an exception.
> This is why I say "In C, you must completely understand the behavior
> of every statement or function, and you *must* handle the possibility
> of errors".

The line:
int integer = real_number;
will produce a warning. (or an error if you are smart enough to
compile with -Werror)

But, if you know that the real number will be small enough and you
don't mind getting the floor of the float, you may wish to ignore the
error. Like mr McKinnon said, c will allow you to do wrong things.

Depending on what you are doing, the babysitting of python, may or may
not be a problem.

One thing I would like to know (not knowing python that well), is when
you make an error in python, when will the exception be thrown? At the
start of run-time, or when the guilty code is encountered? And what if
that code is in a codebranch that gets executed 0.0005% of the time?

Regards
Dirk



  reply	other threads:[~2008-10-30 10:47 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-28 17:07 [gentoo-user] package.keywords syntax? Helmut Jarausch
2008-10-28 17:20 ` Neil Bothwick
2008-10-28 17:22 ` Andrey Vul
2008-10-28 17:39   ` Ricardo Saffi Marques
2008-10-28 17:49     ` Neil Bothwick
2008-10-28 20:29     ` Andrey Vul
2008-10-28 21:01       ` Alan McKinnon
2008-10-28 21:34         ` Jorge Peixoto de Morais Neto
2008-10-28 21:47           ` Robert Bridge
2008-10-28 21:56           ` Alan McKinnon
2008-10-28 22:17             ` Jorge Peixoto de Morais Neto
2008-10-28 22:41               ` Alan McKinnon
2008-10-28 22:55                 ` Jorge Peixoto de Morais Neto
2008-10-29  7:16                   ` Alan McKinnon
2008-10-29 14:16                     ` Andrey Vul
2008-10-29 20:13                     ` Jorge Peixoto de Morais Neto
2008-10-30 10:46                       ` Dirk Uys [this message]
2008-10-30 11:00                         ` Dirk Uys
2008-10-30 18:54                           ` Jorge Peixoto de Morais Neto
2008-10-30 19:11                             ` Albert Hopkins
2008-10-31  8:02                               ` Dirk Uys
2008-10-31  9:54                               ` [gentoo-user] OT: Python (was: package.keywords syntax?) Matthias Bethke
2008-10-31 10:31                                 ` Heiko Wundram
2008-10-30 19:12                         ` [gentoo-user] package.keywords syntax? Jorge Peixoto de Morais Neto
2008-10-31  7:57                           ` Dirk Uys

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=79e3aefb0810300346m19d36196x4f3ec748f6a14be3@mail.gmail.com \
    --to=dirkcuys@gmail.com \
    --cc=gentoo-user@lists.gentoo.org \
    /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