help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] bigmul in glblib05.c


From: Andrew Makhorin
Subject: Re: [Help-glpk] bigmul in glblib05.c
Date: Mon, 4 Jan 2010 22:57:54 +0300

> With MS Visual Studio 2008, unsigned int is four
> bytes and unsigned short is two bytes.

Not only in ms. It is the general convention accepted in ILP32
and LP64 programming models, which glpk conforms to. For more details
please see: http://www.unix.org/version2/whatsnew/lp64_wp.html .

>   If the value of the unsigned
> int t is greater than maximum unsigned short, how will x[i+j] =
> (unsigned short)t; be executed?

Since t is unsigned int, (unsigned short)t is its lower 16 bits,
i.e. it is the same as t % 65536U or t & 0xFFFFU.

FYI:
The routines bigmul and bigdiv implement algorithms from "The Art
of Computer Programming" by Don Knuth (the second volume).





reply via email to

[Prev in Thread] Current Thread [Next in Thread]