From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HELO_NO_DOMAIN,MAILING_LIST_MULTI,RDNS_NONE,SPOOFED_FREEMAIL_NO_RDNS autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,25aa3c7e1b59f7b5 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-05 04:48:05 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!xmission!isdnet!enst!enst.fr!not-for-mail From: "Gautier Write-only-address" Newsgroups: comp.lang.ada Subject: Re: A case where Ada defaults to unsafe? Date: Sat, 05 Jan 2002 12:47:17 +0000 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: avanie.enst.fr 1010234882 40817 137.194.161.2 (5 Jan 2002 12:48:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Sat, 5 Jan 2002 12:48:02 +0000 (UTC) To: comp.lang.ada@ada.eu.org Return-Path: X-Originating-IP: [217.162.132.193] X-OriginalArrivalTime: 05 Jan 2002 12:47:18.0077 (UTC) FILETIME=[1BE08ED0:01C195E7] Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.6 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:18579 Date: 2002-01-05T12:47:17+00:00 >If I use "and" and I'm wrong in assuming that the order doesn't matter, >then I have introduced a subtle bug. If I'm right, then I haven't gained >anything. So why not always use "and then"? The short circuit is not always the faster. A good compiler can much more aggressively optimize an "x>=0 and x<=xmax" than "x>=0 and then x<=xmax"; in addition "and then" introduces branch(es) in the machine code, this is a performance penalty on processors like the Pentiums. ____________________________________________________________ Gautier -- http://www.mysunrise.ch/users/gdm/index.htm#Ada NB: For a direct answer, address on the Web site! _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx