Re: [Mingw-w64-public] bug: conversion of integers and other numbers not there

2012-03-16 Thread Ruben Van Boxem
off-topic questions on this mailing list. GCC nor MinGW-w64 is as buggy as you seem to think. Ruben > > >> ____________________ >> From: Martin Mitáš >> To: mingw-w64-public@lists.sourceforge.net >> Sent: Thursday, March 15, 2012 12:57 AM >> Subject

Re: [Mingw-w64-public] bug: conversion of integers and other numbers not there

2012-03-15 Thread Jim Michaels
a professor put this out as a programming example or someone put this out in a "how not to program in c++" book. > > From: Martin Mitáš >To: mingw-w64-public@lists.sourceforge.net >Sent: Thursday, March 15, 2012 12:57 AM >Subject: Re: [

Re: [Mingw-w64-public] bug: conversion of integers and other numbers not there

2012-03-15 Thread Martin Mitáš
It works correctly, because sizeof(int) == 4 and 1250 is too big for 32 bits. If you take the least significant four bytes of that value, you get (what a surprise) exactly 445948416. The three vars are expanded from short to int and multiplicated (still into an int), then the result is e

[Mingw-w64-public] bug: conversion of integers and other numbers not there

2012-03-14 Thread Jim Michaels
bug: conversion of integers and other numbers not there. #include #include using namespace std; int main(void) {     unsigned short cyl=5000, head=5000, sector=5000;     uint64_t n=cyl * head * sector; //result should be     cout<<"result should be 1250:="