delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/12/16/06:35:59

From: root AT jacob DOT remcomp DOT fr (root)
Subject: Re: rint function (continued)
16 Dec 1998 06:35:59 -0800 :
Message-ID: <m0zq26d-0008SnC.cygnus.gnu-win32@jacob.remcomp.fr>
References: <4 DOT 1 DOT 19981214084527 DOT 035e9470 AT pop DOT ni DOT net>
To: jdeifik AT weasel DOT com (Jeff Deifik)
Cc: gnu-win32 AT cygnus DOT com

In gnu assembler language rint is:

	.globl	_rint
_rint:
        fldl    4(%esp)	; load double argument in the fpu
        push    %eax	; make space in stack for result
        fistpl  (%esp)	; store the rounded value there as 32 bit int
        popl    %eax	; pop the result from the stack
        ret		; done

This takes the current rounding mode into account, as rint should. Using this
function makes your program pass all your tests.

Enjoy!

-- 
Jacob Navia	Logiciels/Informatique
41 rue Maurice Ravel			Tel 01 48.23.51.44
93430 Villetaneuse 			Fax 01 48.23.95.39
France
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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