Paavo Helde wrote:

> "DavidW" <(E-Mail Removed)> wrote in

> news:4d23a28f$0$18555$(E-Mail Removed):

>> Thanks. It's for a solver for a game show:

>> http://en.wikipedia.org/wiki/Countdo...#Numbers_round

>>

>> I think longs should have sufficient capacity for the actual

>> solutions, but overflows could occur in trying all the possibilities,

>> so I'll think about whether to use doubles everywhere.

>

> The long datatype is 32 bits with VC++. If this is not sufficient a

> logical step would be to use a 64-bit integer type (called __int64 in

> VC++6 IIRC). Modern compilers provide int64_t through <stdint.h>.

> There are variants of stdint.h also usable with VC++6 (see the end of

> http://en.wikipedia.org/wiki/Stdint.h).
Yes, I've written it with a typedef to compile it with __int64. As it turns out,

32-bit ints are enough. I didn't bother to calculate it out before. The maximum

value with the restrictions imposed by the rules is 100*75*50*25*10*10 =

937,500,000, which is less than 2^31. But I might use __int64 anyway so

experiments can be done without restrictions except on the maximum for an item

value.