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
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: [
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
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:="