From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 20 Nov 91 23:59:27 GMT From: micro-heart-of-gold.mit.edu!wupost!sdd.hp.com!uakari.primate.wisc.edu!use net.coe.montana.edu!milton!mfeldman@bloom-beacon.mit.edu (Michael Feldman) Subject: Re: Red-faced professor gets bitten in search for portability Message-ID: <1991Nov20.235927.27849@milton.u.washington.edu> List-Id: In article <9111191534.AA20295@ajpo.sei.cmu.edu> ncohen@WATSON.IBM.COM ("Norman H. Cohen") writes: [ stuff deleted ] > >This is one of the primitive functions that the Numerics Rapporteur >Group of ISO-IEC/JTC1/SC22/WG9 is now working on, with the goal of >establishing an ISO standard Generic Primitive Functions package. >(Do not confuse this with the Generic Elementary Functions package, >which has, if I recall correctly, already been submitted to SC22 as a >draft standard. The primitive functions are operations like truncation, >determining the exponent of a floating-point number, determining the >mantissa of a floating-point number, and so forth. They are most >straightforwardly implemented by dealing directly with the target >machine's floating-point representation, so compilers are likely to >treat these functions as intrinsics, replacing calls to them with >inline code. The elementary functions are higher-level operations like >the trig functions, logarithms, and square root, which can be implemented >portably in terms of the elementary functions.) This is good. I think it's overdue and hope it happens soon. > > > By the way - I am all the more red-faced because I let the dangerous > > Trunc monster loose into a textbook. 'Course, I haven't run into > > another Ada text that even discusses the question... > >Don't lose sleep over it! I presume (pray) that no safety-critical >application will incorporate an algorithm from any textbook without >further careful scrutiny. Compared to the flub in Dr. Ruth's book >(incorrectly describing the time of the month at which a woman can >conceive as the time at which the risk of pregnancy is LOWEST), this is >no big deal. Gosh! You mean safety-critical folks don't trust textbooks :-) I'm red-faced but not insomniac about it. As a fellow author, you'll understand the "Aarrgghh!" aspect of it. Dr. Ruth's bug was clearly more serious. Mike