[U-Boot-Users] Compiler question: integer division?

Steven Scholz steven.scholz at imc-berlin.de
Mon Apr 25 10:27:27 CEST 2005


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




More information about the U-Boot mailing list