From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steven Scholz Date: Mon, 25 Apr 2005 10:27:27 +0200 Subject: [U-Boot-Users] Compiler question: integer division? In-Reply-To: <42693193.9070300@imc-berlin.de> References: <42692C53.1020305@imc-berlin.de> <42693021.7090908@smiths-aerospace.com> <42693193.9070300@imc-berlin.de> Message-ID: <426CA9EF.6080003@imc-berlin.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.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