|
Boost : |
From: Victor A. Wagner, Jr. (vawjr_at_[hidden])
Date: 2002-08-22 11:40:14
At Thursday 2002/08/22 09:07, you wrote:
>From: "Victor A. Wagner, Jr." <vawjr_at_[hidden]>\
>
>
> > At Thursday 2002/08/22 01:23, you wrote:
[deleted]
> > >Everyone is forgetting that integer overflow on signed types results in
> > >undefined behaviour.
> >
> > This is an artifact of the language definition (a poor one, IMO). When
>_I_
> > learned multiplication (way back when I was 6 or 7) I noticed pretty
>quick
> > that if I multiplied a n digit number by an m digit number I _might_ get
>an
> > m+n digit number. The first several computers I worked on always
>produced
> > a "two word" product from two "one word" operands. I was somewhat
> > disappointed to learn that the HLL's all seemed to ignore this "basic
>fact"
> > of mathematics. <shrug> it's what we're stuck with, tho I still consider
> > it mostly intellectual laziness that led to it. Especially with strongly
> > typed languages now.
>
>But every one of these languages has a max-sized integral type. Would you
>disallow
>
> 65536L * 3L
>
>in C++98?
no I wouldn't disallow it.
what I would do, depends on the maximum value that can be contained in a
"long".
I'm one of those weirdos that thinks that "correct" is a lot more important
than "fast".
>-Dave
>
>
>-----------------------------------------------------------
> David Abrahams * Boost Consulting
>dave_at_[hidden] * http://www.boost-consulting.com
>
>
>_______________________________________________
>Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Victor A. Wagner Jr. http://rudbek.com
PGP RSA fingerprint = 4D20 EBF6 0101 B069 3817 8DBF C846 E47A
PGP D-H fingerprint = 98BC 65E3 1A19 43EC 3908 65B9 F755 E6F4 63BB 9D93
The five most dangerous words in the English language:
"There oughta be a law"
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk