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,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a11a564bb5e4dd56,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-09-28 12:59:28 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.telusplanet.net!ps01-chi1!rip!newsfeeds-atl1.usenetserver.com!news.webusenet.com!pc01.webusenet.com!e3500-atl1.usenetserver.com.POSTED!not-for-mail From: "gilrain" Newsgroups: comp.lang.ada Subject: Trouble with s'fraction attribute. X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: X-Complaints-To: abuse@usenetserver.com X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly. NNTP-Posting-Date: Sat, 28 Sep 2002 15:44:55 EDT Organization: WEBUSENET.com Date: Sat, 28 Sep 2002 15:01:24 -0500 Xref: archiver1.google.com comp.lang.ada:29406 Date: 2002-09-28T15:01:24-05:00 List-Id: Hi all, I'm writing a program in which I need to seperate the integer and fractional parts of a float. After reading some documentation, it seemed like this should do the trick: with ada.text_io, ada.float_text_io; use ada.text_io, ada.float_text_io; procedure test is number, int, fl : float; begin number := 2.9; int := float'truncation(number); fl := float'fraction(number); put(int,0,0,0); new_line; put(fl,0,0,0); end test; When this is run, int truncates as expected outputs as "2.0". Good. However, fl outputs as "0.7", which isn't at all what I expected (0.9) or wanted. What's going on here? I expect I've somehow misunderstood what the s'fraction attribute does; is there a standard function for what I'm trying to accomplish? Thanks, John Thile