All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Scholz <steven.scholz@imc-berlin.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Compiler question: integer division?
Date: Mon, 25 Apr 2005 10:27:27 +0200	[thread overview]
Message-ID: <426CA9EF.6080003@imc-berlin.de> (raw)
In-Reply-To: <42693193.9070300@imc-berlin.de>

Steven Scholz wrote:

> Hi Jerry,
> 
>>> I just wondered if the code
>>>
>>>     return (dtt_read(sensor, DTT_READ_TEMP) / 256);
>>>
>>> would be result in a "shift by 8" or and interger division?
>>
>>
>> Short answer: Yes.

How about

	a = b / 5;
  ?

Will that result in

	a = (b >> 2) - b;

, i.e. still no division but only shift operations?

-- 

Steven

  reply	other threads:[~2005-04-25  8:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-22 16:54 [U-Boot-Users] Compiler question: integer division? Steven Scholz
2005-04-22 17:10 ` Jerry Van Baren
2005-04-22 17:17   ` Steven Scholz
2005-04-25  8:27     ` Steven Scholz [this message]
2005-04-25  9:04       ` AW: " Reinhard Meyer
2005-04-25  9:35       ` Wolfgang Denk
2005-04-25 10:30         ` Steven Scholz
2005-04-25 14:31       ` Udi Finkelstein
2005-04-25 15:13 ` [U-Boot-Users] " Sergei Sharonov
  -- strict thread matches above, loose matches on Subject: below --
2005-04-25  8:35 [U-Boot-Users] " Fillod Stephane

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=426CA9EF.6080003@imc-berlin.de \
    --to=steven.scholz@imc-berlin.de \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.