help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] bigmul in glblib05.c


From: Andrew Makhorin
Subject: [Help-glpk] bigmul in glblib05.c
Date: Wed, 6 Jan 2010 05:46:40 +0300

> These codes are replaced with
> 
> unsigned short c = (unsigned short)( i & USHRT_MAX);
> 
> The modified codes can produce 13.75 for vpm2.mps of MIPLIB 2003.

I am not sure why you are changing the code. Doesn't the original
version work for you? The glpk code is highly portable, and there is
no need to "improve" its portability in such way.

The statement:

   unsigned short c = (unsigned short)( i & USHRT_MAX);

is absolutely equivalent to:

   unsigned short c = (unsigned short)i;

You can ignore msvc warnings like "A cast to a smaller data type has
caused a loss of data", because "i & USHRT_MAX" (as advised by msvc)
also causes "a loss of data".





reply via email to

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