Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: 64-bit integer division problem in CrossWorks(r) for ARM

2005-03-10 by ytremil

--- In lpc2000@yahoogroups.com, "moruisg" <je@r...> wrote:
> 
> Hi,
> 
> Which version of CrossWorks for ARM are you using? You can 
use "Help |
> About CrossStudio" to determine the version and build number.
> 
> I can't reproduce the problem, so can you provide some source code
> that demonstrates the problem you are seeing?
> 
> Regards,
> 
> Jon Elliott
> Rowley Associates Ltd
> 

Hi,

This is a simple example:

long long a = 1767040273612800LL;
long long b = 2365440384LL;
long long c;

int main(void)
{
  c = a/b;
  return 0;
}

After division, "c"  has value 747009,but correct result - 747023.

Another few numbers:

  1767020750438400 / 2365439945 = 747015,
   but CrossWorks give 747008;

  1767001050316800 / 2365438870 = 747007,
   but CrossWorks give 746528 (!)

My CrossStudio(r) current version - 1.3 Build 5
(with ver. 1.2 - the same problem)

In LPC2106,S3C44B0X,ARM Simulator -  the same problem.


Regards,

 Yuri Tiomkin,
 http://www.tnkernel.com

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.