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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ff38128f63397494 X-Google-Attributes: gid103376,public From: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: Help with Translation, please! Date: 1996/03/15 Message-ID: #1/1 X-Deja-AN: 142914247 distribution: world references: <4gvta2$531@ds8.scri.fsu.edu> <4h2gu9$hp6@watnews1.watson.ibm.com> organization: The Mitre Corp., Bedford, MA. newsgroups: comp.lang.ada Date: 1996-03-15T00:00:00+00:00 List-Id: In article <4hvvm2$ird@ds8.scri.fsu.edu> jac@ds8.scri.fsu.edu (Jim Carr) writes: eachus@spectre.mitre.org (Robert I. Eachus) writes: > > .... The same holds for factorials. They can be generated >exactly in (small) constant time and space. (Actually, if you are not >using floating point, the time is proportional to the square of the >length of the result...) > Make up your mind. ;-) > Constant or square? A loop is better than linear in the length. It depends on whether you use a computation model where arithmetic operations require constant time or require time proportional to the length of the operands. In the case of factorial it matters. > And your comment about a sqrt based method, if one exists, seems > to ignore the extra time required -vs- multiplication. Anyway, > my main application looks up log(n!) so its a moot point. Well since no one took the challenge, how about an extra hint. The ONE square root you need is the square root of five.. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...