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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,937456e2dd44bde1,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-08-12 05:29:27 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: vashwathus@yahoo.com (Ashwath) Newsgroups: comp.lang.ada Subject: Floating point representation-help Date: 12 Aug 2002 05:29:27 -0700 Organization: http://groups.google.com/ Message-ID: <14763faf.0208120429.658b842d@posting.google.com> NNTP-Posting-Host: 203.90.88.229 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1029155367 22018 127.0.0.1 (12 Aug 2002 12:29:27 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 12 Aug 2002 12:29:27 GMT Xref: archiver1.google.com comp.lang.ada:27945 Date: 2002-08-12T12:29:27+00:00 List-Id: Have look at the following program with TEXT_IO; with UNCHECKED_CONVERSION; procedure UNCHECK_DEMO is package INT_IO is new TEXT_IO.INTEGER_IO(LONG_LONG_INTEGER); function INT_TO_FLT is new UNCHECKED_CONVERSION( SOURCE => LONG_LONG_INTEGER, TARGET => FLOAT); INT : LONG_LONG_INTEGER; FLT : FLOAT; begin INT:=2#11111111100000000000000000000000#; FLT:=INT_TO_FLT(INT); INT_IO.put(INT,0,2); end; Now look at the following sentences which explains how to find the exact value of a 32 bit word (This 32 bit word is IEEE single precision floating point standard representation). The value V represented by the word may be determined as follows:(Concentrate on condition 2). 1)If E=255 and F is nonzero, then V=NaN ("Not a number") 2)If E=255 and F is zero and S is 1, then V=-Infinity 3)If E=255 and F is zero and S is 0, then V=Infinity 4)If 0