Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #6081
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
| Newsgroups | comp.programming |
| Subject | Re: Here is why C++ and C are bad... |
| Date | Wed, 30 Dec 2015 16:32:52 +0000 |
| Organization | A noiseless patient Spider |
| Lines | 22 |
| Message-ID | <87bn977v7v.fsf@bsb.me.uk> (permalink) |
| References | <n5kdn4$cji$1@dont-email.me> <n5uqdd$gin$1@dont-email.me> <n5v0di$7i3$1@dont-email.me> <n5v0p5$8s3$1@dont-email.me> <n6063m$ccb$1@dont-email.me> <n60m14$lf$1@dont-email.me> <n60nkf$65m$1@dont-email.me> |
| Mime-Version | 1.0 |
| Content-Type | text/plain |
| Injection-Info | mx02.eternal-september.org; posting-host="017616aa25f81ec581c44d76d61ba2f3"; logging-data="10197"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18zuoKGMnxu0P9OsApcUUKSGrhSOlQIZRM=" |
| Cancel-Lock | sha1:cH8Qp0iyIICpuHuIe4c54BsybdE= sha1:iY4r3h4LLCA0xeNeYw3k4fjudyc= |
| X-BSB-Auth | 1.85965302ab7008296442.20151230163252GMT.87bn977v7v.fsf@bsb.me.uk |
| Xref | csiph.com comp.programming:6081 |
Show key headers only | View raw
David Brown <david.brown@hesbynett.no> writes:
> On 30/12/15 14:28, Richard Heathfield wrote:
<snip>
>> int i = -6;
>> unsigned int j = 42;
>> if(i < j)
>> {
>> puts("-6 is less than 42");
>> }
<snip>
> Of course, this in itself is just a specialist case of the difference
> between "normal" mathematics and numbers in C. Replace the first two
> lines with "int16_t i = 1000000; int16_t j = 4000000;" and you'll find
> that four million is apparently smaller than one million.
You might find that, but you also might not! There is a conversion
which is implementation-defined (and might even raise a signal).
<snip>
--
Ben.
Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: Here is why C++ and C are bad... Richard Heathfield <rjh@cpax.org.uk> - 2015-12-29 20:31 +0000
Re: Here is why C++ and C are bad... Kaz Kylheku <kaz@kylheku.com> - 2015-12-29 21:20 +0000
Re: Here is why C++ and C are bad... David Brown <david.brown@hesbynett.no> - 2015-12-29 23:13 +0100
Re: Here is why C++ and C are bad... Richard Heathfield <rjh@cpax.org.uk> - 2015-12-29 22:19 +0000
Re: Here is why C++ and C are bad... David Brown <david.brown@hesbynett.no> - 2015-12-30 09:56 +0100
Re: Here is why C++ and C are bad... Richard Heathfield <rjh@cpax.org.uk> - 2015-12-30 13:28 +0000
Re: Here is why C++ and C are bad... David Brown <david.brown@hesbynett.no> - 2015-12-30 14:55 +0100
Re: Here is why C++ and C are bad... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-12-30 16:32 +0000
Re: Here is why C++ and C are bad... David Brown <david.brown@hesbynett.no> - 2015-12-30 18:17 +0100
Re: Here is why C++ and C are bad... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-12-30 20:01 +0000
Re: Here is why C++ and C are bad... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-12-30 15:48 +0000
Re: Here is why C++ and C are bad... Richard Heathfield <rjh@cpax.org.uk> - 2015-12-30 16:35 +0000
Re: Here is why C++ and C are bad... David Brown <david.brown@hesbynett.no> - 2015-12-30 18:19 +0100
Re: Here is why C++ and C are bad... Richard Heathfield <rjh@cpax.org.uk> - 2015-12-30 17:39 +0000
Re: Here is why C++ and C are bad... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-12-30 20:26 +0000
Re: Here is why C++ and C are bad... "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2015-12-30 18:32 +0100
Re: Here is why C++ and C are bad... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-12-30 19:55 +0000
Re: Here is why C++ and C are bad... Richard Heathfield <rjh@cpax.org.uk> - 2015-12-30 20:15 +0000
Re: Here is why C++ and C are bad... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-12-30 22:00 +0000
Re: Here is why C++ and C are bad... Ian Collins <ian-news@hotmail.com> - 2015-12-31 10:16 +1300
csiph-web