delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/06/01/15:59:05

Message-Id: <200006011957.WAA01748@alpha.netvision.net.il>
Date: Thu, 01 Jun 2000 22:57:12 +0200
X-Mailer: Emacs 20.6 (via feedmail 8.1.emacs20_6 I) and Blat ver 1.8.5b
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
To: buers AT gmx DOT de (Dieter Buerssner)
CC: djgpp AT delorie DOT com
In-reply-to: <8h67e5.3vs4im1.0@buerssner-17104.user.cis.dfn.de>
Subject: Re: Rounding doubles to ints
References: <39363d0a$0$8416$7f31c96c AT news01 DOT syd DOT optusnet DOT com DOT au> <8h67e5 DOT 3vs4im1 DOT 0 AT buerssner-17104 DOT user DOT cis DOT dfn DOT de>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: buers AT gmx DOT de (Dieter Buerssner)
> Newsgroups: comp.os.msdos.djgpp
> Date: 1 Jun 2000 15:37:29 GMT
>
> AFAIK, DJGPP does not support the C99 function round().

We don't have `round', but we do have `rint', which does the same
thing.  Just remember to put -lm at the end of the link command.

>   /* assume, nobody played with the FPU rounding flags */
>   __asm__ ("frndint" : "=t" (rounded) : "0" (x));

IIRC, the version of `rint' in libm.a rounds correctly in a way that
doesn't depend on the rounding mode (and without fiddling it).

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019