Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #5905 > unrolled thread

Arithmetic overflow checking

Started byrop rop <rop049@gmail.com>
First post2011-07-06 08:35 -0700
Last post2011-07-09 12:16 -0700
Articles 20 on this page of 277 — 46 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Arithmetic overflow checking rop rop <rop049@gmail.com> - 2011-07-06 08:35 -0700
    Re: Arithmetic overflow checking markspace <-@.> - 2011-07-06 09:42 -0700
      Re: Arithmetic overflow checking stefan@nyniva.se - 2011-07-06 11:30 -0700
        Re: Arithmetic overflow checking markspace <-@.> - 2011-07-06 11:36 -0700
        Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-18 23:06 -0400
    Re: Arithmetic overflow checking Patricia Shanahan <pats@acm.org> - 2011-07-06 10:16 -0700
      Re: Arithmetic overflow checking "John B. Matthews" <nospam@nospam.invalid> - 2011-07-07 02:26 -0400
        Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-18 23:07 -0400
      Re: Arithmetic overflow checking Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-07-07 07:11 -0700
        Re: Arithmetic overflow checking Patricia Shanahan <pats@acm.org> - 2011-07-07 10:02 -0700
          Re: Arithmetic overflow checking Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-07-07 17:51 -0700
            Re: Arithmetic overflow checking Patricia Shanahan <pats@acm.org> - 2011-07-07 20:04 -0700
              Re: Arithmetic overflow checking Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-07-07 20:29 -0700
              Re: Arithmetic overflow checking rop rop <rop049@gmail.com> - 2011-07-08 15:52 -0700
                Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-18 23:12 -0400
              Re: Arithmetic overflow checking Tom Anderson <twic@urchin.earth.li> - 2011-07-09 10:31 +0100
                Re: Arithmetic overflow checking rop rop <rop049@gmail.com> - 2011-07-09 02:58 -0700
                  Re: Arithmetic overflow checking Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-09 08:53 -0400
                  Re: Arithmetic overflow checking markspace <-@.> - 2011-07-09 07:46 -0700
                    Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-18 23:17 -0400
                      Re: Arithmetic overflow checking Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-07-18 23:22 -0700
              Re: Arithmetic overflow checking tm <thomas.mertes@gmx.at> - 2011-07-10 01:47 -0700
                Re: Arithmetic overflow checking China Blue Dolls <chine.bleu@yahoo.com> - 2011-07-10 02:47 -0700
                  Re: Arithmetic overflow checking pete <pfiland@mindspring.com> - 2011-07-10 06:04 -0400
                    Re: Arithmetic overflow checking China Blue Dolls <chine.bleu@yahoo.com> - 2011-07-10 03:29 -0700
                      Re: Arithmetic overflow checking Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-07-10 20:52 +0300
                      Re: Arithmetic overflow checking pete <pfiland@mindspring.com> - 2011-07-10 23:29 -0400
                  Re: Arithmetic overflow checking tm <thomas.mertes@gmx.at> - 2011-07-10 04:44 -0700
                    Re: Arithmetic overflow checking "BartC" <bc@freeuk.com> - 2011-07-12 11:33 +0100
                      Re: Arithmetic overflow checking tm <thomas.mertes@gmx.at> - 2011-07-12 04:17 -0700
                        Re: Arithmetic overflow checking "BartC" <bc@freeuk.com> - 2011-07-12 12:33 +0100
                          Re: Arithmetic overflow checking tm <thomas.mertes@gmx.at> - 2011-07-12 05:24 -0700
                            Re: Arithmetic overflow checking Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-12 21:45 -0400
                        Re: Arithmetic overflow checking Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-07-12 05:25 -0700
                          Re: Arithmetic overflow checking tm <thomas.mertes@gmx.at> - 2011-07-12 10:21 -0700
                            Re: Arithmetic overflow checking tm <thomas.mertes@gmx.at> - 2011-07-12 23:54 -0700
                          Re: Arithmetic overflow checking "BartC" <bc@freeuk.com> - 2011-07-12 19:14 +0100
                            Re: Arithmetic overflow checking Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-07-13 00:20 -0700
                      Re: Arithmetic overflow checking markspace <-@.> - 2011-07-12 09:26 -0700
                        Re: Arithmetic overflow checking Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2011-07-12 10:52 -0600
                          Re: Arithmetic overflow checking Keith Thompson <kst-u@mib.org> - 2011-07-12 10:48 -0700
                        Re: Arithmetic overflow checking Martin Gregorie <martin@address-in-sig.invalid> - 2011-07-12 16:54 +0000
                          Re: Arithmetic overflow checking Gene Wirchenko <genew@ocis.net> - 2011-07-12 11:35 -0700
                        Re: Arithmetic overflow checking tm <thomas.mertes@gmx.at> - 2011-07-12 10:13 -0700
                        Re: Arithmetic overflow checking Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-12 21:53 -0400
                      Re: Arithmetic overflow checking "MikeP" <mp011011@some.org> - 2011-07-14 23:41 -0500
                        Re: Arithmetic overflow checking Gene Wirchenko <genew@ocis.net> - 2011-07-15 10:56 -0700
                          Re: Arithmetic overflow checking "MikeP" <mp011011@some.org> - 2011-07-15 21:27 -0500
                    Re: Arithmetic overflow checking bugbear <bugbear@trim_papermule.co.uk_trim> - 2011-07-20 09:22 +0100
                      Re: Arithmetic overflow checking tm <thomas.mertes@gmx.at> - 2011-07-20 10:51 -0700
                        Re: Arithmetic overflow checking gordonb.3urm7@burditt.org (Gordon Burditt) - 2011-07-20 15:39 -0500
                        Re: Arithmetic overflow checking "BartC" <bc@freeuk.com> - 2011-07-21 12:12 +0100
                  Re: Arithmetic overflow checking Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-10 09:28 -0400
                    Re: Arithmetic overflow checking Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-07-10 06:52 -0700
                      Re: Arithmetic overflow checking Keith Thompson <kst-u@mib.org> - 2011-07-10 14:47 -0700
                    Re: Arithmetic overflow checking "MikeP" <mp011011@some.org> - 2011-07-14 23:07 -0500
                  Re: Arithmetic overflow checking Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-07-10 12:25 -0400
                Re: Arithmetic overflow checking Robert Wessel <robertwessel2@yahoo.com> - 2011-07-10 10:47 -0500
                Re: Arithmetic overflow checking Gene Wirchenko <genew@ocis.net> - 2011-07-11 07:58 -0700
                  Re: Arithmetic overflow checking Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-07-11 10:48 -0700
                    Re: Arithmetic overflow checking Gene Wirchenko <genew@ocis.net> - 2011-07-11 14:40 -0700
                  Re: Arithmetic overflow checking tm <thomas.mertes@gmx.at> - 2011-07-11 14:54 -0700
                    Re: Arithmetic overflow checking Gene Wirchenko <genew@ocis.net> - 2011-07-11 15:55 -0700
                    Re: Arithmetic overflow checking Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-11 21:51 -0400
                      Re: Arithmetic overflow checking Gene Wirchenko <genew@ocis.net> - 2011-07-11 21:31 -0700
                        Re: Arithmetic overflow checking Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-07-11 23:16 -0700
                        Re: Arithmetic overflow checking James Kuyper <jameskuyper@verizon.net> - 2011-07-12 06:28 -0400
                        Re: Arithmetic overflow checking David Thompson <dave.thompson2@verizon.net> - 2011-07-24 22:13 -0400
                          Re: Arithmetic overflow checking Lew Pitcher <lpitcher@teksavvy.com> - 2011-07-25 10:24 -0400
                Re: Arithmetic overflow checking "io_x" <a@b.c.invalid> - 2011-07-12 09:05 +0200
                  Re: Arithmetic overflow checking tm <thomas.mertes@gmx.at> - 2011-07-12 02:22 -0700
                    Re: Arithmetic overflow checking "io_x" <a@b.c.invalid> - 2011-07-12 11:34 +0200
                      Re: Arithmetic overflow checking Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-07-12 03:04 -0700
                      Re: Arithmetic overflow checking tm <thomas.mertes@gmx.at> - 2011-07-12 03:33 -0700
                      Re: Arithmetic overflow checking David Lamb <dalamb@cs.queensu.ca> - 2011-07-12 08:29 -0400
                    Re: Arithmetic overflow checking "io_x" <a@b.c.invalid> - 2011-07-12 13:18 +0200
                    Re: Arithmetic overflow checking Gene Wirchenko <genew@ocis.net> - 2011-07-12 11:39 -0700
                      Re: Arithmetic overflow checking Patricia Shanahan <pats@acm.org> - 2011-07-12 12:38 -0700
                        Re: Arithmetic overflow checking markspace <-@.> - 2011-07-12 13:20 -0700
                          Re: Arithmetic overflow checking Gene Wirchenko <genew@ocis.net> - 2011-07-12 13:23 -0700
                            Re: Arithmetic overflow checking Martin Gregorie <martin@address-in-sig.invalid> - 2011-07-12 21:08 +0000
                              Re: Arithmetic overflow checking lewbloch <lewbloch@gmail.com> - 2011-07-12 14:48 -0700
                                Re: Arithmetic overflow checking Gene Wirchenko <genew@ocis.net> - 2011-07-12 15:24 -0700
                                  Re: Arithmetic overflow checking lewbloch <lewbloch@gmail.com> - 2011-07-12 16:09 -0700
                                    Re: Arithmetic overflow checking Gene Wirchenko <genew@ocis.net> - 2011-07-13 10:38 -0700
                                      Re: Arithmetic overflow checking Patricia Shanahan <pats@acm.org> - 2011-07-13 11:00 -0700
                                      Re: Arithmetic overflow checking lewbloch <lewbloch@gmail.com> - 2011-07-13 12:16 -0700
                                        Re: Arithmetic overflow checking Gene Wirchenko <genew@ocis.net> - 2011-07-13 13:10 -0700
                                        Re: Arithmetic overflow checking markspace <-@.> - 2011-07-13 13:21 -0700
                                          Re: Arithmetic overflow checking Keith Thompson <kst-u@mib.org> - 2011-07-13 13:41 -0700
                                            Re: Arithmetic overflow checking Robert Wessel <robertwessel2@yahoo.com> - 2011-07-14 21:10 -0500
                                              Re: Arithmetic overflow checking "io_x" <a@b.c.invalid> - 2011-07-15 11:57 +0200
                                                Re: Arithmetic overflow checking Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-07-15 04:36 -0700
                                    Re: Arithmetic overflow checking Niklas Holsti <niklas.holsti@tidorum.invalid> - 2011-08-13 21:54 +0300
                    Re: Arithmetic overflow checking tm <thomas.mertes@gmx.at> - 2011-07-13 00:52 -0700
                      Re: Arithmetic overflow checking Patricia Shanahan <pats@acm.org> - 2011-07-13 07:45 -0700
                Re: Arithmetic overflow checking Wolfgang Draxinger <wdraxinger@darkstargames.de> - 2011-09-08 21:02 +0200
                  Re: Arithmetic overflow checking Wolfgang Draxinger <wdraxinger@darkstargames.de> - 2011-09-08 21:12 +0200
                    Re: Arithmetic overflow checking Willem <willem@toad.stack.nl> - 2011-09-08 19:15 +0000
                      Re: Arithmetic overflow checking Wolfgang Draxinger <wdraxinger@darkstargames.de> - 2011-09-08 22:24 +0200
            Re: Arithmetic overflow checking Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-08 00:30 -0400
              Re: Arithmetic overflow checking Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-07-08 01:29 -0700
                Re: Arithmetic overflow checking markspace <-@.> - 2011-07-08 07:38 -0700
                  Re: Arithmetic overflow checking Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-08 20:40 -0400
                    Re: Arithmetic overflow checking markspace <-@.> - 2011-07-08 18:17 -0700
                      Re: Arithmetic overflow checking Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-07-08 19:49 -0700
                        Re: Arithmetic overflow checking markspace <-@.> - 2011-07-08 22:26 -0700
                  Re: Arithmetic overflow checking Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-07-08 17:42 -0700
              Re: Arithmetic overflow checking Tom Anderson <twic@urchin.earth.li> - 2011-07-09 10:21 +0100
              Re: Arithmetic overflow checking David Lamb <dalamb@cs.queensu.ca> - 2011-07-10 10:53 -0400
                Re: Arithmetic overflow checking Martin Gregorie <martin@address-in-sig.invalid> - 2011-07-10 18:07 +0000
                  Re: Arithmetic overflow checking Patricia Shanahan <pats@acm.org> - 2011-07-10 11:29 -0700
                    Re: Arithmetic overflow checking Martin Gregorie <martin@address-in-sig.invalid> - 2011-07-10 19:22 +0000
                      Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-21 16:40 -0400
                        Re: Arithmetic overflow checking Martin Gregorie <martin@address-in-sig.invalid> - 2011-07-21 23:06 +0000
                          Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-21 19:38 -0400
                          Re: Arithmetic overflow checking Henderson <h1@g1.f1> - 2011-07-22 00:27 -0400
                            Re: Arithmetic overflow checking Martin Gregorie <martin@address-in-sig.invalid> - 2011-07-22 13:00 +0000
                    Re: Arithmetic overflow checking markspace <-@.> - 2011-07-10 17:17 -0700
            Re: Arithmetic overflow checking Gene Wirchenko <genew@ocis.net> - 2011-07-08 10:23 -0700
              Re: Arithmetic overflow checking "John B. Matthews" <nospam@nospam.invalid> - 2011-07-08 19:30 -0400
                Re: Arithmetic overflow checking Gene Wirchenko <genew@ocis.net> - 2011-07-11 08:04 -0700
              Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-21 16:43 -0400
            Re: Arithmetic overflow checking "MikeP" <mp011011@some.org> - 2011-07-15 00:28 -0500
        Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-18 23:09 -0400
      Re: Arithmetic overflow checking "MikeP" <mp011011@some.org> - 2011-07-15 00:14 -0500
        Re: Arithmetic overflow checking Patricia Shanahan <pats@acm.org> - 2011-07-15 07:00 -0700
          Re: Arithmetic overflow checking lewbloch <lewbloch@gmail.com> - 2011-07-15 08:09 -0700
            Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-20 22:07 -0400
          Re: Arithmetic overflow checking "MikeP" <mp011011@some.org> - 2011-07-15 23:29 -0500
            Re: Arithmetic overflow checking Patricia Shanahan <pats@acm.org> - 2011-07-15 22:26 -0700
              Re: Arithmetic overflow checking "MikeP" <mp011011@some.org> - 2011-07-16 00:32 -0500
                Re: Arithmetic overflow checking lewbloch <lewbloch@gmail.com> - 2011-07-16 11:00 -0700
                  Re: Arithmetic overflow checking Patricia Shanahan <pats@acm.org> - 2011-07-16 11:15 -0700
                    Re: Arithmetic overflow checking "MikeP" <mp011011@some.org> - 2011-07-16 15:41 -0500
                      Re: Arithmetic overflow checking Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-07-16 23:18 +0000
                        Re: Arithmetic overflow checking "MikeP" <mp011011@some.org> - 2011-07-17 00:30 -0500
            Re: Arithmetic overflow checking "John B. Matthews" <nospam@nospam.invalid> - 2011-07-16 08:39 -0400
              Re: Arithmetic overflow checking lewbloch <lewbloch@gmail.com> - 2011-07-16 10:33 -0700
                Re: Arithmetic overflow checking "MikeP" <mp011011@some.org> - 2011-07-16 15:51 -0500
                  Re: Arithmetic overflow checking lewbloch <lewbloch@gmail.com> - 2011-07-17 08:46 -0700
                    Re: Arithmetic overflow checking "MikeP" <mp011011@some.org> - 2011-07-18 07:03 -0500
                      Re: Arithmetic overflow checking lewbloch <lewbloch@gmail.com> - 2011-07-18 06:21 -0700
              Re: Arithmetic overflow checking "MikeP" <mp011011@some.org> - 2011-07-16 15:43 -0500
                Re: Arithmetic overflow checking "John B. Matthews" <nospam@nospam.invalid> - 2011-07-17 09:50 -0400
                  Re: Arithmetic overflow checking Patricia Shanahan <pats@acm.org> - 2011-07-17 08:15 -0700
                    Re: Arithmetic overflow checking "John B. Matthews" <nospam@nospam.invalid> - 2011-07-18 01:12 -0400
                    Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-21 16:50 -0400
                  Re: Arithmetic overflow checking "MikeP" <mp011011@some.org> - 2011-07-18 06:56 -0500
                    Re: Arithmetic overflow checking David Lamb <dalamb@cs.queensu.ca> - 2011-07-18 19:26 -0400
                Re: Arithmetic overflow checking Gene Wirchenko <genew@ocis.net> - 2011-07-18 15:03 -0700
              Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-20 22:16 -0400
                Re: Arithmetic overflow checking Henderson <h1@g1.f1> - 2011-07-20 22:25 -0400
                  Re: Arithmetic overflow checking David Lamb <dalamb@cs.queensu.ca> - 2011-07-21 08:50 -0400
                    Re: Arithmetic overflow checking lewbloch <lewbloch@gmail.com> - 2011-07-21 07:37 -0700
                    Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-21 16:52 -0400
                Re: Arithmetic overflow checking Martin Gregorie <martin@address-in-sig.invalid> - 2011-07-21 12:19 +0000
                  Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-21 16:54 -0400
                    Re: Arithmetic overflow checking Gene Wirchenko <genew@ocis.net> - 2011-07-21 14:46 -0700
                      Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-21 18:10 -0400
                      Re: Arithmetic overflow checking Martin Gregorie <martin@address-in-sig.invalid> - 2011-07-21 23:22 +0000
                      Re: Arithmetic overflow checking "John B. Matthews" <nospam@nospam.invalid> - 2011-07-21 21:47 -0400
                      Re: Arithmetic overflow checking David Lamb <dalamb@cs.queensu.ca> - 2011-07-23 10:15 -0400
            Re: Arithmetic overflow checking lewbloch <lewbloch@gmail.com> - 2011-07-16 10:46 -0700
              Re: Arithmetic overflow checking Patricia Shanahan <pats@acm.org> - 2011-07-16 11:13 -0700
            Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-20 22:09 -0400
              Re: Arithmetic overflow checking lewbloch <lewbloch@gmail.com> - 2011-07-20 21:01 -0700
              Re: Arithmetic overflow checking Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-07-21 07:05 -0300
                Re: Arithmetic overflow checking supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-07-21 06:28 -0400
                  Re: Arithmetic overflow checking Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-07-21 12:32 +0000
                    Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-21 16:58 -0400
                      Re: Arithmetic overflow checking Patricia Shanahan <pats@acm.org> - 2011-07-21 15:58 -0700
                        Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-21 19:14 -0400
                        Re: Arithmetic overflow checking Martin Gregorie <martin@address-in-sig.invalid> - 2011-07-22 13:07 +0000
                        Re: Arithmetic overflow checking Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-07-22 17:33 +0000
                          Re: Arithmetic overflow checking lewbloch <lewbloch@gmail.com> - 2011-07-22 13:36 -0700
                            Re: Arithmetic overflow checking Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-07-22 23:16 +0000
                              Re: Arithmetic overflow checking Patricia Shanahan <pats@acm.org> - 2011-07-22 16:50 -0700
                                Re: Arithmetic overflow checking Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-07-23 20:09 +0000
                                  Re: Arithmetic overflow checking Patricia Shanahan <pats@acm.org> - 2011-07-24 08:56 -0700
                              Re: Arithmetic overflow checking lewbloch <lewbloch@gmail.com> - 2011-07-23 09:37 -0700
                    Re: Arithmetic overflow checking David Lamb <dalamb@cs.queensu.ca> - 2011-07-23 11:23 -0400
                      Re: Arithmetic overflow checking supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-07-23 12:04 -0400
                        Re: Arithmetic overflow checking David Lamb <dalamb@cs.queensu.ca> - 2011-07-23 14:45 -0400
                          Re: Arithmetic overflow checking lewbloch <lewbloch@gmail.com> - 2011-07-23 11:51 -0700
                            Re: Arithmetic overflow checking supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-07-23 22:39 -0400
                              Re: Arithmetic overflow checking Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-07-25 10:20 -0700
                                Re: Arithmetic overflow checking supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-07-25 13:29 -0400
                                  Re: Arithmetic overflow checking David Lamb <dalamb@cs.queensu.ca> - 2011-07-25 13:35 -0400
                      Re: Arithmetic overflow checking lewbloch <lewbloch@gmail.com> - 2011-07-23 09:39 -0700
                        Re: Arithmetic overflow checking Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-07-23 21:09 +0000
                          Re: Arithmetic overflow checking Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-07-23 21:24 +0000
                Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-21 16:57 -0400
            Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-20 22:12 -0400
          Re: Arithmetic overflow checking Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-07-21 06:41 -0300
            Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-21 16:38 -0400
    Re: Arithmetic overflow checking Wanja Gayk <brixomatic@yahoo.com> - 2011-07-06 22:28 +0200
      Re: Arithmetic overflow checking Wanja Gayk <brixomatic@yahoo.com> - 2011-07-06 22:30 +0200
      Re: Arithmetic overflow checking Tom Anderson <twic@urchin.earth.li> - 2011-07-06 22:32 +0100
        Re: Arithmetic overflow checking rop rop <rop049@gmail.com> - 2011-07-07 00:30 -0700
          Re: Arithmetic overflow checking Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-07 07:54 -0400
            Re: Arithmetic overflow checking rop rop <rop049@gmail.com> - 2011-07-07 05:36 -0700
            Re: Arithmetic overflow checking Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-07-07 19:11 +0200
          Re: Arithmetic overflow checking Tom Anderson <twic@urchin.earth.li> - 2011-07-07 14:21 +0100
        Re: Arithmetic overflow checking Stanimir Stamenkov <s7an10@netscape.net> - 2011-07-09 16:34 +0300
    Re: Arithmetic overflow checking Roedy Green <see_website@mindprod.com.invalid> - 2011-07-06 22:41 -0700
      Re: Arithmetic overflow checking Gene Wirchenko <genew@ocis.net> - 2011-07-07 14:34 -0700
        Re: Arithmetic overflow checking Patricia Shanahan <pats@acm.org> - 2011-07-07 14:53 -0700
          Re: Arithmetic overflow checking Gene Wirchenko <genew@ocis.net> - 2011-07-07 17:12 -0700
            Re: Arithmetic overflow checking lewbloch <lewbloch@gmail.com> - 2011-07-07 17:29 -0700
              Re: Arithmetic overflow checking Gene Wirchenko <genew@ocis.net> - 2011-07-08 10:27 -0700
                Re: Arithmetic overflow checking lewbloch <lewbloch@gmail.com> - 2011-07-08 13:15 -0700
                  Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-19 20:54 -0400
                    Re: Arithmetic overflow checking markspace <-@.> - 2011-07-19 18:07 -0700
                      Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-19 21:31 -0400
                        Re: Arithmetic overflow checking Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-07-20 07:36 -0300
                          Re: Arithmetic overflow checking RedGrittyBrick <RedGrittyBrick@spamweary.invalid> - 2011-07-20 11:58 +0100
                            Re: Arithmetic overflow checking lewbloch <lewbloch@gmail.com> - 2011-07-20 09:51 -0700
                              Re: Arithmetic overflow checking RedGrittyBrick <RedGrittyBrick@spamweary.invalid> - 2011-07-21 12:11 +0100
                                Re: Arithmetic overflow checking Martin Gregorie <martin@address-in-sig.invalid> - 2011-07-21 12:43 +0000
                                  Re: Arithmetic overflow checking Tom McGlynn <taqmcglynn@googlemail.com> - 2011-07-21 07:15 -0700
                                Re: Arithmetic overflow checking lewbloch <lewbloch@gmail.com> - 2011-07-21 07:35 -0700
                                  Re: Arithmetic overflow checking Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-07-21 15:38 +0000
                                    Re: Arithmetic overflow checking lewbloch <lewbloch@gmail.com> - 2011-07-21 09:03 -0700
                                      Re: Arithmetic overflow checking Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-07-21 12:00 -0700
                                        Re: Arithmetic overflow checking Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-07-22 17:16 +0000
                                          Re: Arithmetic overflow checking David Lamb <dalamb@cs.queensu.ca> - 2011-07-23 11:28 -0400
                                            Re: Arithmetic overflow checking Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-07-23 21:03 +0000
                                              Re: Arithmetic overflow checking Henderson <h1@g1.f1> - 2011-07-23 22:55 -0400
                                                Re: Arithmetic overflow checking Patricia Shanahan <pats@acm.org> - 2011-07-24 09:16 -0700
                                                  Re: Arithmetic overflow checking markspace <-@.> - 2011-07-24 10:40 -0700
                                                    Re: Arithmetic overflow checking Patricia Shanahan <pats@acm.org> - 2011-07-24 10:54 -0700
                                                      Re: Arithmetic overflow checking markspace <-@.> - 2011-07-24 11:09 -0700
                                                        Re: Arithmetic overflow checking Patricia Shanahan <pats@acm.org> - 2011-07-24 12:53 -0700
                                                          Re: Arithmetic overflow checking markspace <-@.> - 2011-07-24 15:15 -0700
                                                            Re: Arithmetic overflow checking Patricia Shanahan <pats@acm.org> - 2011-07-24 15:41 -0700
                                                  Re: Arithmetic overflow checking Henderson <h1@g1.f1> - 2011-07-25 03:21 -0400
                                                    Re: Arithmetic overflow checking Patricia Shanahan <pats@acm.org> - 2011-07-25 00:56 -0700
                                                      Re: Arithmetic overflow checking Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-07-25 07:03 -0300
                                                      Re: Arithmetic overflow checking Thomas Richter <thor@math.tu-berlin.de> - 2011-07-26 09:43 +0200
                                                    Re: Arithmetic overflow checking Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-07-25 11:06 +0000
                                                      Re: Arithmetic overflow checking Henderson <h1@g1.f1> - 2011-07-25 11:12 -0400
                                                        Re: Arithmetic overflow checking Patricia Shanahan <pats@acm.org> - 2011-07-25 09:09 -0700
                                                          Re: Arithmetic overflow checking Patricia Shanahan <pats@acm.org> - 2011-07-25 09:30 -0700
                                                        Re: Arithmetic overflow checking David Lamb <dalamb@cs.queensu.ca> - 2011-07-25 13:33 -0400
                                                          Re: Arithmetic overflow checking "John B. Matthews" <nospam@nospam.invalid> - 2011-07-26 03:04 -0400
                                                        Re: Arithmetic overflow checking Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-07-26 03:28 -0400
                                                          Re: Arithmetic overflow checking Henderson <h1@g1.f1> - 2011-07-26 04:53 -0400
                                                            Re: Arithmetic overflow checking Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-07-26 11:35 -0400
                                                              Re: Arithmetic overflow checking Patricia Shanahan <pats@acm.org> - 2011-07-26 10:48 -0700
                                    Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-21 17:00 -0400
                          Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-20 19:50 -0400
                            Re: Arithmetic overflow checking Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-07-20 23:21 -0300
                              Re: Arithmetic overflow checking Martin Gregorie <martin@address-in-sig.invalid> - 2011-07-21 12:52 +0000
                                Re: Arithmetic overflow checking Henderson <h1@g1.f1> - 2011-07-21 15:58 -0400
                              Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-21 17:06 -0400
                        Re: Arithmetic overflow checking Gene Wirchenko <genew@ocis.net> - 2011-07-20 14:35 -0700
                          Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-20 18:22 -0400
                            Re: Arithmetic overflow checking Gene Wirchenko <genew@ocis.net> - 2011-07-21 14:54 -0700
              Re: Arithmetic overflow checking rop rop <rop049@gmail.com> - 2011-07-08 15:34 -0700
                Re: Arithmetic overflow checking Gene Wirchenko <genew@ocis.net> - 2011-07-11 08:09 -0700
                  Re: Arithmetic overflow checking Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-07-11 10:30 -0700
                    Re: Arithmetic overflow checking Gene Wirchenko <genew@ocis.net> - 2011-07-11 14:43 -0700
                      Re: Arithmetic overflow checking Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-07-11 14:49 -0700
                        Re: Arithmetic overflow checking Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-07-17 17:14 +0200
                          Re: Arithmetic overflow checking David Lamb <dalamb@cs.queensu.ca> - 2011-07-18 19:28 -0400
                            Re: Arithmetic overflow checking Patricia Shanahan <pats@acm.org> - 2011-07-18 16:36 -0700
                    Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-19 21:33 -0400
                Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-19 20:56 -0400
                  Re: Arithmetic overflow checking Gene Wirchenko <genew@ocis.net> - 2011-07-20 14:36 -0700
                    Re: Arithmetic overflow checking Arne Vajhøj <arne@vajhoej.dk> - 2011-07-20 18:24 -0400
                      Re: Arithmetic overflow checking Gene Wirchenko <genew@ocis.net> - 2011-07-21 14:55 -0700
    Re: Arithmetic overflow checking Roedy Green <see_website@mindprod.com.invalid> - 2011-07-06 22:43 -0700
    Re: Arithmetic overflow checking Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2011-07-07 14:56 +0300
    Re: Arithmetic overflow checking "Nasser M. Abbasi" <nma@12000.org> - 2011-07-08 21:27 -0700
      Re: Arithmetic overflow checking "Nasser M. Abbasi" <nma@12000.org> - 2011-07-08 21:57 -0700
      Re: Arithmetic overflow checking lewbloch <lewbloch@gmail.com> - 2011-07-09 12:16 -0700

Page 2 of 14 — ← Prev page 1 [2] 3 4 … 14  Next page →


#6280

FromPeter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com>
Date2011-07-18 23:22 -0700
Message-ID<BvadnX9ee6sFv7jTnZ2dnUVZ_hOdnZ2d@posted.palinacquisition>
In reply to#6279
On 7/18/11 8:17 PM, Arne Vajhøj wrote:
> [...]
>> I did a quick check of the C# variant when it was mentioned here, and
>> this is how they do it:
>>
>> int result = checked( a + b - c );
>>
>> [...]
>
> Just note that C# is a bit more rich than that:
>
> default and compiled with /checked- => checked(expression) and
> checked { } do overflow check for expression / block but do not
> for the rest
>
> compiled with /checked+ => unchecked(expression) and
> unchecked { } do not overflow check for expression / block
> but do for the rest

As long as we're calling out the specifics: it may be important to know 
that in C#, statically computable expressions (more specifically, those 
that contain only constants) are always checked unless in an explicit 
"unchecked" block, even if the default setting is used.

[toc] | [prev] | [next] | [standalone]


#6029

Fromtm <thomas.mertes@gmx.at>
Date2011-07-10 01:47 -0700
Message-ID<3797038f-22d1-40b2-8c12-60db5a0976b8@t5g2000yqj.googlegroups.com>
In reply to#5977
On 8 Jul., 05:04, Patricia Shanahan <p...@acm.org> wrote:
> On 7/7/2011 5:51 PM, Peter Duniho wrote:
> ...
>
> > I would not worry about the "simple" or "efficient" criteria. IMHO, if
> > one is deciding to apply overflow checking to every computation, one has
> > already abandoned the hope of efficiency.
>
> Not necessarily. I assumed a couple of decades ago that array index
> checking would be impossibly inefficient, but it seems to work fine in
> Java.

And in other languages, like Pascal, Ada and Seed7, as well.

> I suspect that having integer range types would be a major help.
> When I'm working out whether an int can overflow, I often think in terms
> of the ranges of inputs to calculations. A compiler would be able to
> tell that adding a digit to a digit always fits in the range [0,18].

I think there are two things:

  1. range checks (like value fits in [0,18]).
  2. check if an 32-bit (or 8-bit, 16-bit, 64-bit, ...)
     computation overflows.

In the 1. case a compiler could generate code that does
the computation and checks the range afterwards.
In the 2. case a computation could result in wrong data,
because the overflow was silently ignored. In this case
either some checks must be done before the computation or
the overfow condition is recognized during or after the
computation. In an ideal world the hardware would do this.

A CPU could (in theory) easily recognize the overflow
and generate an interrupt. This way normal computations
(without overflow) would have no extra cost. AFAIK
commonly used CPUs do not have this possibility. They
have some FLAG, which is set when an overflow occurred.
But there is no possibility to cause an interrupt, when
the overflow FLAG is set. So code, which checks for
overflow, must check this flag after every computation.
Needless to say: Normal computations (without overflow)
are slowed down by this checks.

Because of this slow down most compilers and virtual
machines (AFAIK inluding the JVM) have no overflow
checking.

In other words: A missing hardware feature:

  Trigger interupt when overflow flag is set.

Causes compilers and JVMs to omit overflow checks.


Greetings Thomas Mertes

--
Seed7 Homepage:  http://seed7.sourceforge.net
Seed7 - The extensible programming language: User defined statements
and operators, abstract data types, templates without special
syntax, OO with interfaces and multiple dispatch, statically typed,
interpreted or compiled, portable, runs under linux/unix/windows.

[toc] | [prev] | [next] | [standalone]


#6032

FromChina Blue Dolls <chine.bleu@yahoo.com>
Date2011-07-10 02:47 -0700
Message-ID<chine.bleu-F754B3.02470710072011@news.eternal-september.org>
In reply to#6029
In article <3797038f-22d1-40b2-8c12-60db5a0976b8@t5g2000yqj.googlegroups.com>,
 tm <thomas.mertes@gmx.at> wrote:

> On 8 Jul., 05:04, Patricia Shanahan <p...@acm.org> wrote:
> > On 7/7/2011 5:51 PM, Peter Duniho wrote:
> > ...
> >
> > > I would not worry about the "simple" or "efficient" criteria. IMHO, if
> > > one is deciding to apply overflow checking to every computation, one has
> > > already abandoned the hope of efficiency.
> >
> > Not necessarily. I assumed a couple of decades ago that array index
> > checking would be impossibly inefficient, but it seems to work fine in
> > Java.
> 
> And in other languages, like Pascal, Ada and Seed7, as well.

In C the array size is not part of the type or value, so there is nothing to 
check. Addressing an array outside its allocation is undefined in general, but 
an implementation can define it anyway.

>   2. check if an 32-bit (or 8-bit, 16-bit, 64-bit, ...)
>      computation overflows.

C integer arithmetic is always modulo M, for some large M (like 2**32 or 2**64). 
So the concept of overflow does not apply.

>   Trigger interupt when overflow flag is set.

Not all CPUs detect integer arithmetic overflow. Not all CPUs signal integer 
arithmetic problems.

-- 
I remember finding out about you,  |A free Thai dyed shirt in every box.
Everyday my mind is all around you,|      I'm whoever you want me to be.
Looking out from my lonely room    | Annoying Usenet one post at a time.
Day after day.                     |   At least I can stay in character.

[toc] | [prev] | [next] | [standalone]


#6033

Frompete <pfiland@mindspring.com>
Date2011-07-10 06:04 -0400
Message-ID<4E19791F.3E45@mindspring.com>
In reply to#6032
China Blue Dolls wrote:
 
> In C the array size is not part of the type or value,
> so there is nothing to check.

In C, 
the size of an array is part of the type of the array.

-- 
pete

[toc] | [prev] | [next] | [standalone]


#6034

FromChina Blue Dolls <chine.bleu@yahoo.com>
Date2011-07-10 03:29 -0700
Message-ID<chine.bleu-9C8828.03291510072011@news.eternal-september.org>
In reply to#6033
In article <4E19791F.3E45@mindspring.com>, pete <pfiland@mindspring.com> wrote:

> China Blue Dolls wrote:
>  
> > In C the array size is not part of the type or value,
> > so there is nothing to check.
> 
> In C, 
> the size of an array is part of the type of the array.

extern char s[];

-- 
I remember finding out about you,  |A free Thai dyed shirt in every box.
Everyday my mind is all around you,|      I'm whoever you want me to be.
Looking out from my lonely room    | Annoying Usenet one post at a time.
Day after day.                     |   At least I can stay in character.

[toc] | [prev] | [next] | [standalone]


#6053

FromPhil Carmody <thefatphil_demunged@yahoo.co.uk>
Date2011-07-10 20:52 +0300
Message-ID<87k4bq2fc2.fsf@bazspaz.fatphil.org>
In reply to#6034
China Blue Dolls <chine.bleu@yahoo.com> writes:
> In article <4E19791F.3E45@mindspring.com>, pete <pfiland@mindspring.com> wrote:
> > China Blue Dolls wrote:
> >  
> > > In C the array size is not part of the type or value,
> > > so there is nothing to check.
> > 
> > In C, 
> > the size of an array is part of the type of the array.

One might even say that array types are characterized by their
element type and by the number of elements in the array.
 
> extern char s[];

That's not an array, that's a promise that somewhere else there's
an array.

Phil
-- 
"At least you know where you are with Microsoft."
"True. I just wish I'd brought a paddle." -- Matthew Vernon

[toc] | [prev] | [next] | [standalone]


#6066

Frompete <pfiland@mindspring.com>
Date2011-07-10 23:29 -0400
Message-ID<4E1A6E37.6499@mindspring.com>
In reply to#6034
China Blue Dolls wrote:
> 
> In article <4E19791F.3E45@mindspring.com>, pete <pfiland@mindspring.com> wrote:

> > In C,
> > the size of an array is part of the type of the array.
> 
> extern char s[];

That's called an "incomplete type".

-- 
pete

[toc] | [prev] | [next] | [standalone]


#6039

Fromtm <thomas.mertes@gmx.at>
Date2011-07-10 04:44 -0700
Message-ID<289ad570-65fc-49d8-9cc8-1f15d13ff3e3@gv8g2000vbb.googlegroups.com>
In reply to#6032
On 10 Jul., 11:47, China Blue Dolls <chine.b...@yahoo.com> wrote:
> In article <3797038f-22d1-40b2-8c12-60db5a097...@t5g2000yqj.googlegroups.com>,
>
>  tm <thomas.mer...@gmx.at> wrote:
> > On 8 Jul., 05:04, Patricia Shanahan <p...@acm.org> wrote:
> > > On 7/7/2011 5:51 PM, Peter Duniho wrote:
> > > ...
>
> > > > I would not worry about the "simple" or "efficient" criteria. IMHO, if
> > > > one is deciding to apply overflow checking to every computation, one has
> > > > already abandoned the hope of efficiency.
>
> > > Not necessarily. I assumed a couple of decades ago that array index
> > > checking would be impossibly inefficient, but it seems to work fine in
> > > Java.
>
> >   2. check if an 32-bit (or 8-bit, 16-bit, 64-bit, ...)
> >      computation overflows.
>
> C integer arithmetic is always modulo M, for some large M (like 2**32 or 2**64).
> So the concept of overflow does not apply.
>
> >   Trigger interupt when overflow flag is set.
>
> Not all CPUs detect integer arithmetic overflow. Not all CPUs signal integer
> arithmetic problems.

And popular CPUs, which do detect integer overflow, do not
trigger an interupt. This makes zero overhead overflow
detection impossible.

So software suffers because hardware / CPU designers want
to save a transistor...


Greetings Thomas Mertes

--
Seed7 Homepage:  http://seed7.sourceforge.net
Seed7 - The extensible programming language: User defined statements
and operators, abstract data types, templates without special
syntax, OO with interfaces and multiple dispatch, statically typed,
interpreted or compiled, portable, runs under linux/unix/windows.

[toc] | [prev] | [next] | [standalone]


#6113

From"BartC" <bc@freeuk.com>
Date2011-07-12 11:33 +0100
Message-ID<ivh7ub$qtp$1@dont-email.me>
In reply to#6039
"tm" <thomas.mertes@gmx.at> wrote in message
news:289ad570-65fc-49d8-9cc8-1f15d13ff3e3@gv8g2000vbb.googlegroups.com...

> And popular CPUs, which do detect integer overflow, do not
> trigger an interupt. This makes zero overhead overflow
> detection impossible.
>
> So software suffers because hardware / CPU designers want
> to save a transistor...

Even if zero-overhead detection was possible, it's difficult to know how to
make use of this in C. For example:

int a,b,c;

c=a+b;

The a+b overflows, but then what? You can't then magically switch over to:

long long int a,b,c;

Even /with/ the overhead, it's difficult to see what could follow such an
expression:

 if (overflow(c=a+b)) ...

In the context of C-based code for implementing auto-ranging, dynamic types
of /another language/, this might be workable, but still difficult to see
how it can be done with zero-overhead. But this is a limited application
(which I wouldn't even attempt in C because it's so fiddly).

Aborting a program is also a possibility, but this just helps in debugging,
and overheads are less relevant.

(There is a longer thread on this in comp.lang.misc: "Integer arithmetic" 
from around start of March 2011.)

-- 
Bartc 

[toc] | [prev] | [next] | [standalone]


#6115

Fromtm <thomas.mertes@gmx.at>
Date2011-07-12 04:17 -0700
Message-ID<a642c317-92bf-47a3-995a-2839d17c98ba@cq10g2000vbb.googlegroups.com>
In reply to#6113
On 12 Jul., 12:33, "BartC" <b...@freeuk.com> wrote:
> "tm" <thomas.mer...@gmx.at> wrote in message
>
> news:289ad570-65fc-49d8-9cc8-1f15d13ff3e3@gv8g2000vbb.googlegroups.com...
>
> > And popular CPUs, which do detect integer overflow, do not
> > trigger an interupt. This makes zero overhead overflow
> > detection impossible.
>
> > So software suffers because hardware / CPU designers want
> > to save a transistor...
>
> Even if zero-overhead detection was possible, it's difficult to know how to
> make use of this in C. For example:
>
> int a,b,c;
>
> c=a+b;
>
> The a+b overflows, but then what? You can't then magically switch over to:
>
> long long int a,b,c;

No, when a+b overflows, there is a bug in the program.
The purpose of overflow detection is NOT support for
unlimited precision integers. When the programmer thinks,
that all his computations will fit in an int, he can use
it (for performance or other reasons). In this case
he probably wants to know when his approach was wrong.

Most programmers want correct results, or the
information that something went wrong. Reasons where
wrong results are acceptable should be left out from
this discussion.

> Even /with/ the overhead, it's difficult to see what could follow such an
> expression:
>
>  if (overflow(c=a+b)) ...

I dont think that checking every expression in your program
makes sense. The runtime library (maybe in cooperation with
the OS) should do the job.

Signals and exceptions are the right mechanism to notify
a program that an overflow occurred.

> In the context of C-based code for implementing auto-ranging, dynamic types
> of /another language/, ...

You seem to see overflow detection as a possibility to
support unlimited precision integers. But this is NOT
the main reason to use it. In C and other languages
integer values are used for two things:

  1. Integer arithmetic ( + - * / )
  2. Bit manipulation (shifts, masks, logical and, logical or)

Bit manipulation works best without overflow detection.
For this reason C supports unsigned int, where overflows
are silently ignored.

Integer arithmetic, where overflows are ignored, leads to
wrong results. So overflow detection makes much sense
for integer arithmetic. C leaves the overflow beviour of
signed integers unspecified. Unfortunately many other
languages followed this decision.

> this might be workable, but still difficult to see
> how it can be done with zero-overhead.

The hardware triggers an interrupt and the program
recieves a signal or an exception.

> But this is a limited application
> (which I wouldn't even attempt in C because it's so fiddly).

It is only fiddly when you intend to check every
expression in your program. When you use some
exception (or signal) handlers it is not fiddly.

> Aborting a program is also a possibility, but this just helps in debugging,
> and overheads are less relevant.

A program that fails to catch an exception (or signal)
is aborted.

> (There is a longer thread on this in comp.lang.misc: "Integer arithmetic"
> from around start of March 2011.)

Probably my arguments can also be found in this thread. :-)


Greetings Thomas Mertes

--
Seed7 Homepage:  http://seed7.sourceforge.net
Seed7 - The extensible programming language: User defined statements
and operators, abstract data types, templates without special
syntax, OO with interfaces and multiple dispatch, statically typed,
interpreted or compiled, portable, runs under linux/unix/windows.

[toc] | [prev] | [next] | [standalone]


#6116

From"BartC" <bc@freeuk.com>
Date2011-07-12 12:33 +0100
Message-ID<ivhbf9$fdv$1@dont-email.me>
In reply to#6115
"tm" <thomas.mertes@gmx.at> wrote in message 
news:a642c317-92bf-47a3-995a-2839d17c98ba@cq10g2000vbb.googlegroups.com...
> On 12 Jul., 12:33, "BartC" <b...@freeuk.com> wrote:
>> "tm" <thomas.mer...@gmx.at> wrote in message
>>
>> news:289ad570-65fc-49d8-9cc8-1f15d13ff3e3@gv8g2000vbb.googlegroups.com...
>>
>> > And popular CPUs, which do detect integer overflow, do not
>> > trigger an interupt. This makes zero overhead overflow
>> > detection impossible.
>>
>> > So software suffers because hardware / CPU designers want
>> > to save a transistor...

>> int a,b,c;
>>
>> c=a+b;
>>
>> The a+b overflows, but then what? You can't then magically switch over 
>> to:
>>
>> long long int a,b,c;
>
> No, when a+b overflows, there is a bug in the program.
> The purpose of overflow detection is NOT support for
> unlimited precision integers. When the programmer thinks,
> that all his computations will fit in an int, he can use
> it (for performance or other reasons). In this case
> he probably wants to know when his approach was wrong.
>
> Most programmers want correct results, or the
> information that something went wrong. Reasons where
> wrong results are acceptable should be left out from
> this discussion.

OK, so it's for debugging purposes. In this case, any overhead (of extra 
instructions to check flags and interrupt or whatever) is less important, 
and can be (and needs to be) optional.

-- 
Bartc 

[toc] | [prev] | [next] | [standalone]


#6118

Fromtm <thomas.mertes@gmx.at>
Date2011-07-12 05:24 -0700
Message-ID<f1f7faad-11bb-4050-aac2-96f48106bcd9@fv14g2000vbb.googlegroups.com>
In reply to#6116
On 12 Jul., 13:33, "BartC" <b...@freeuk.com> wrote:
> "tm" <thomas.mer...@gmx.at> wrote in message
>
> news:a642c317-92bf-47a3-995a-2839d17c98ba@cq10g2000vbb.googlegroups.com...
>
>
>
> > On 12 Jul., 12:33, "BartC" <b...@freeuk.com> wrote:
> >> "tm" <thomas.mer...@gmx.at> wrote in message
>
> >>news:289ad570-65fc-49d8-9cc8-1f15d13ff3e3@gv8g2000vbb.googlegroups.com...
>
> >> > And popular CPUs, which do detect integer overflow, do not
> >> > trigger an interupt. This makes zero overhead overflow
> >> > detection impossible.
>
> >> > So software suffers because hardware / CPU designers want
> >> > to save a transistor...
> >> int a,b,c;
>
> >> c=a+b;
>
> >> The a+b overflows, but then what? You can't then magically switch over
> >> to:
>
> >> long long int a,b,c;
>
> > No, when a+b overflows, there is a bug in the program.
> > The purpose of overflow detection is NOT support for
> > unlimited precision integers. When the programmer thinks,
> > that all his computations will fit in an int, he can use
> > it (for performance or other reasons). In this case
> > he probably wants to know when his approach was wrong.
>
> > Most programmers want correct results, or the
> > information that something went wrong. Reasons where
> > wrong results are acceptable should be left out from
> > this discussion.
>
> OK, so it's for debugging purposes.

Not alone. Arithmetic overflow checking should be also
done in production. Like you want to know also when a
production system does division by zero, dereferences
NULL, accesses memory outside the process (SEGV),
accesses array elements outside of an array or does
other illegal things.

For that reason I am interested in hardware support to
do (near) zero overhead arithmetic overflow detection.

> In this case, any overhead (of extra
> instructions to check flags and interrupt or whatever) is less important,
> and can be (and needs to be) optional.

Sometimes extra instructions are necessary, to do
some checks. But, except for rare cases, reasonable
checks should be done in a production system also.

The philosophy: No checks in a production system should
be a thing of the past.


Greetings Thomas Mertes

--
Seed7 Homepage:  http://seed7.sourceforge.net
Seed7 - The extensible programming language: User defined statements
and operators, abstract data types, templates without special
syntax, OO with interfaces and multiple dispatch, statically typed,
interpreted or compiled, portable, runs under linux/unix/windows.

[toc] | [prev] | [next] | [standalone]


#6143

FromEric Sosman <esosman@ieee-dot-org.invalid>
Date2011-07-12 21:45 -0400
Message-ID<ivitbm$lm2$1@dont-email.me>
In reply to#6118
On 7/12/2011 8:24 AM, tm wrote:
> [...]
> The philosophy: No checks in a production system should
> be a thing of the past.

     "Test what you fly, fly what you test."

-- 
Eric Sosman
esosman@ieee-dot-org.invalid

[toc] | [prev] | [next] | [standalone]


#6117

FromMalcolm McLean <malcolm.mclean5@btinternet.com>
Date2011-07-12 05:25 -0700
Message-ID<d16ec56b-6e94-473d-80b4-b2ddfcf58850@r18g2000vbs.googlegroups.com>
In reply to#6115
On Jul 12, 2:17 pm, tm <thomas.mer...@gmx.at> wrote:
> On 12 Jul., 12:33, "BartC" <b...@freeuk.com> wrote:
>
> > The a+b overflows, but then what? You can't then magically switch over to:
>
> > long long int a,b,c;
>
> No, when a+b overflows, there is a bug in the program.
> The purpose of overflow detection is NOT support for
> unlimited precision integers. When the programmer thinks,
> that all his computations will fit in an int, he can use
> it (for performance or other reasons). In this case
> he probably wants to know when his approach was wrong.
>
The problem is that 32 bit ints are large enough to count most things,
but not all.

You can't give a different 32-bit integer to everyone in the world,
for example, nor to all the bytes of RAM you might reasonably have in
your desktop computer.

64 bit ints solve most of these problems, they can count the vast
majority of things we need to count.
--
The campaign  for 64-bit ints
Coming soon to http://www.malcolmmclean.site11.com/www

[toc] | [prev] | [next] | [standalone]


#6125

Fromtm <thomas.mertes@gmx.at>
Date2011-07-12 10:21 -0700
Message-ID<1ca84a18-e879-4249-a9e2-cea8c1ad7b92@ct4g2000vbb.googlegroups.com>
In reply to#6117
On 12 Jul., 14:25, Malcolm McLean <malcolm.mcle...@btinternet.com>
wrote:
> On Jul 12, 2:17 pm, tm <thomas.mer...@gmx.at> wrote:> On 12 Jul., 12:33, "BartC" <b...@freeuk.com> wrote:
>
> > > The a+b overflows, but then what? You can't then magically switch over to:
>
> > > long long int a,b,c;
>
> > No, when a+b overflows, there is a bug in the program.
> > The purpose of overflow detection is NOT support for
> > unlimited precision integers. When the programmer thinks,
> > that all his computations will fit in an int, he can use
> > it (for performance or other reasons). In this case
> > he probably wants to know when his approach was wrong.
>
> The problem is that 32 bit ints are large enough to count most things,
> but not all.
>
> You can't give a different 32-bit integer to everyone in the world,
> for example, nor to all the bytes of RAM you might reasonably have in
> your desktop computer.
>
> 64 bit ints solve most of these problems, they can count the vast
> majority of things we need to count.

When CPUs moved from 16 to 32 bit integers the argumentation
was similar.

Using 64 bit ints only shifts the problem, but does NOT
solve it. Only overflow detection and unlimited precision
integers can solve it.


Greetings Thomas Mertes

--
Seed7 Homepage:  http://seed7.sourceforge.net
Seed7 - The extensible programming language: User defined statements
and operators, abstract data types, templates without special
syntax, OO with interfaces and multiple dispatch, statically typed,
interpreted or compiled, portable, runs under linux/unix/windows.

[toc] | [prev] | [next] | [standalone]


#6152

Fromtm <thomas.mertes@gmx.at>
Date2011-07-12 23:54 -0700
Message-ID<990875cf-1497-49e6-a07d-1fd31c974e2d@o4g2000vbv.googlegroups.com>
In reply to#6125
On 12 Jul., 23:18, Keith Thompson <ks...@mib.org> wrote:
> tm <thomas.mer...@gmx.at> writes:
> > On 12 Jul., 22:39, Thomas Boell <tbo...@domain.invalid> wrote:
> >> On Tue, 12 Jul 2011 10:21:44 -0700 (PDT)
>
> >> tm <thomas.mer...@gmx.at> wrote:
> >> > Using 64 bit ints only shifts the problem, but does NOT
> >> > solve it. Only overflow detection and unlimited precision
> >> > integers
>
> >>  and unlimited amounts of RAM
>
> > Libraries supporting unlimited precision integers usually
> > raise a MEMORY_EXCEPTION when there is not enough memory
> > to represent an integer. At least my bigInteger library
> > (see:http://seed7.sourceforge.net/libraries/bigint.htm)
> > works this way. :-)
>
> Or, if they're in C rather than C++, they either return a result
> or set errno to some value that indicates they've run out of memory.

My librariy is written in C, but it raises a Seed7 exception
in out of memory situations. :-)
Does GMP set errno when it runs out of memory?

I am not sure that Java can handle out of memory situations
with an exception.


Greetings Thomas Mertes

--
Seed7 Homepage:  http://seed7.sourceforge.net
Seed7 - The extensible programming language: User defined statements
and operators, abstract data types, templates without special
syntax, OO with interfaces and multiple dispatch, statically typed,
interpreted or compiled, portable, runs under linux/unix/windows.

[toc] | [prev] | [next] | [standalone]


#6127

From"BartC" <bc@freeuk.com>
Date2011-07-12 19:14 +0100
Message-ID<ivi2uo$g9r$1@dont-email.me>
In reply to#6117
"Malcolm McLean" <malcolm.mclean5@btinternet.com> wrote in message
news:d16ec56b-6e94-473d-80b4-b2ddfcf58850@r18g2000vbs.googlegroups.com...

> The problem is that 32 bit ints are large enough to count most things,
> but not all.
>
> You can't give a different 32-bit integer to everyone in the world,

Just give two each...

> for example, nor to all the bytes of RAM you might reasonably have in
> your desktop computer.

No, you need up to 40-bits, if there is really a need to address every byte
in each object, and in every task, uniquely.

> 64 bit ints solve most of these problems, they can count the vast
> majority of things we need to count.

When you start doing arithmetic requiring bigger numbers, then 64-bits won't
be enough either. If you're calculating factorials, it means you can go up
to 20! instead of 12! Big deal...

And if you're advocating always using 64-bits, whether it's needed or not, 
then you could be doubling or quadrupling memory needs, and bandwidth, 
unnecessarily. Especially on a machine with a natural word size of 32-bits.

-- 
Bartc 

[toc] | [prev] | [next] | [standalone]


#6153

FromMalcolm McLean <malcolm.mclean5@btinternet.com>
Date2011-07-13 00:20 -0700
Message-ID<9c08a22f-7fb0-479e-98a5-201f689c6d0a@a11g2000yqm.googlegroups.com>
In reply to#6127
On Jul 12, 9:14 pm, "BartC" <b...@freeuk.com> wrote:
> "Malcolm McLean" <malcolm.mcle...@btinternet.com> wrote in message
>
> And if you're advocating always using 64-bits, whether it's needed or not,
> then you could be doubling or quadrupling memory needs, and bandwidth,
> unnecessarily. Especially on a machine with a natural word size of 32-bits.
>
We need to find out where memory is actually used.

For instance my current program work with genetic sequence data. When
memory gets tight, that's normally because I need an NxN matrix of
genes in an organism, where N is about 6000. However day to day, most
of the memory is used by sequence data - which fits comfortably into
2GB - a list of genes might be 15 megabytes.

So in my case, moving to 64 bit ints wouldn't impact memory
requirements at all. However that's not necessarily true of everyone.
--
Bioinformatics programming goodies:
vist my website http://www.malcolmmclean.site11.com/www


[toc] | [prev] | [next] | [standalone]


#6121

Frommarkspace <-@.>
Date2011-07-12 09:26 -0700
Message-ID<ivhskb$1gp$1@dont-email.me>
In reply to#6113
On 7/12/2011 6:16 AM, Stefan Ram wrote:
> "BartC"<bc@freeuk.com>  writes:
>> a+b overflows, but then what?
>
>    This can only be answered given the requirements
>    specification of a specific project.


What I think he's saying is there's no way physically detect the 
overflow in a language like C which has no exceptions.  You'd have to at 
least introduce some sort of global flag.

   int c = a + b;
   if( GLOBAL_OVERFLOW_FLAG ) {
     printf( "bugger..." );
   }

[toc] | [prev] | [next] | [standalone]


#6122

FromJoe Pfeiffer <pfeiffer@cs.nmsu.edu>
Date2011-07-12 10:52 -0600
Message-ID<1boc0zcugu.fsf@snowball.wb.pfeifferfamily.net>
In reply to#6121
markspace <-@.> writes:

> On 7/12/2011 6:16 AM, Stefan Ram wrote:
>> "BartC"<bc@freeuk.com>  writes:
>>> a+b overflows, but then what?
>>
>>    This can only be answered given the requirements
>>    specification of a specific project.
>
>
> What I think he's saying is there's no way physically detect the
> overflow in a language like C which has no exceptions.  You'd have to
> at least introduce some sort of global flag.
>
>   int c = a + b;
>   if( GLOBAL_OVERFLOW_FLAG ) {
>     printf( "bugger..." );
>   }

Well, yes there is.  For example on an addition, if both operands have
the same sign and the result is the other sign, you had an overflow.
Analogous conditions exist (which I don't remember off the top of my
head and am too lazy to look up) exist for subtraction and
multiplication.  Integer division can't overflow.

My reading of the question was "OK, you've detected an overflow.  Now
what do you do about it?" and the (correct) answer was, in essence,
"well, what do you *want* to do about it?"

[toc] | [prev] | [next] | [standalone]


Page 2 of 14 — ← Prev page 1 [2] 3 4 … 14  Next page →

Back to top | Article view | comp.lang.java.programmer


csiph-web