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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7e8cebf09cf80560 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!goblin3!goblin.stu.neva.ru!exi-transit.telstra.net!news.telstra.net!exi-spool.telstra.net!exi-reader.telstra.net!not-for-mail From: "robin" Newsgroups: comp.lang.ada References: <4d80b140$0$43832$c30e37c6@exi-reader.telstra.net> <4d810172$0$4954$a8266bb1@postbox2.readnews.com> Subject: Re: How would Ariane 5 have behaved if overflow checking were not turned off? Date: Sat, 19 Mar 2011 08:14:54 +1100 X-Newsreader: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Message-ID: <4d8475d6$0$43834$c30e37c6@exi-reader.telstra.net> NNTP-Posting-Host: 123.3.27.205 X-Trace: 1300526550 exi-reader.telstra.net 43834 123.3.27.205:1030 Xref: g2news2.google.com comp.lang.ada:19281 Date: 2011-03-19T08:14:54+11:00 List-Id: KK6GM wrote in message ... >On Mar 16, 11:29 am, Hyman Rosen wrote: >> How about this for the essential flaw: Does it really make >> sense to create data types in your program that are so closely >> tied to external factors like rocket speed limits and angles? >> Why not use data types that could handle the full range of >> values from the sensor? The approach used seems incredibly >> brittle, and in fact turned out to be so. >Here's the alternative, for the Ariane situation. A float value gets >converted to a 16-bit integer. The float value is too big to fit >(let's say it's 33000). What 16-bit int will that get converted to? >-31000? Would you believe 32767 (with appropriate sign). That keeps the processor running, and it's slightly less than the actual value. > Some random value? How does continuing along with bogus data >make the situation better? It keeps the processor running, and the mission going. > Will the control loops really work OK with >bogus feedback data? >If you have determined via thorough analysis that the variable in >question can only _ever_ have a valid range of e.g. -20000 to 20000, >and it goes to 33000, what _is_ the right action? Set it to 32767 with sign. Alterrnativelty, use floating-point.