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=3.8 required=5.0 tests=BAYES_00,INVALID_MSGID, RATWARE_MS_HASH,RATWARE_OUTLOOK_NONAME autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fedc2d05e82c9174 X-Google-Attributes: gid103376,public From: "bob" Subject: Re: Calculating SQRT in ADA Date: 1999/03/24 Message-ID: <01be7613$c90ed040$0e2915c0@w95>#1/1 X-Deja-AN: 458431039 References: Organization: B & D Associates X-NETCOM-Date: Wed Mar 24 10:31:22 AM CST 1999 Newsgroups: comp.lang.ada Date: 1999-03-24T10:31:22-06:00 List-Id: Several possibilities. If you are using gnat Ada95, the following is a possibility: [snip] with text_io; with Ada.Numerics.Generic_Elementary_Functions; use text_io; package body vectors is package math is new Ada.Numerics.Generic_Elementary_Functions(real); use math; package fio is new float_io(real); use fio; [snip] -- Evaluate the magnitude of a vector function mag(v : vector) return real is begin return sqrt(v(1)**2 + v(2)**2 + v(3)**2); end mag; [snip] end vectors; In Ada83 or Ada95, if the target is real, possibly the following: x : real; [snip] x = x**0.5; [snip] All of the Ada85 comilers I have used supply a "math" package containing sqrt also. cheers....bob cmcrae wrote in article ... > I am trying to calculate the SQRT in ADA. Is there a function that I > can access? > -- > Posted via Talkway - http://www.talkway.com > Surf Usenet at home, on the road, and by email -- always at Talkway. > >