🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.forth
Article #135

Re: bug in mpfr-3.1.0

#135
From: Krishna Myneni
Date: Mon, 19 Oct 2026 11:01
91 lines
3510 bytes
On 10/18/26 11:42 AM, marcel hendrix wrote:
> iForth uses the mpfr 3.1.0 release, and possibly other Forths do too. I 
> have found that the mpfr_pow(rop, op1,op2,roundingmode) function does 
> not work for at least *some* values of op1 (0 and 1 works) that are a 
> power of 2 (0 and 1 work). The source hints at this, the documentation 
> does not.
> 
...
> 
> FORTH> LET (2,3):  F#** .print  @.Inf@e-0003 ok
> FORTH> LET (2,2):  F#** .print  @.Inf@e-0001 ok
> FORTH> LET (3,2):  F#** .print
I'm currently using MPFR ver 4.2.1.

Both mpfr_pow and mpfr_pow_ui appear to be working:

2^3
r1 = 0.200000000000000000000000000000000000000000000000000000000000E1
r2 = 0.300000000000000000000000000000000000000000000000000000000000E1

Using mpfr_pow
r1^r2 = 0.800000000000000000000000000000000000000000000000000000000000E1

Using mpfr_pow_ui
r1^3 = 0.800000000000000000000000000000000000000000000000000000000000E1

2^2
r1 = 0.200000000000000000000000000000000000000000000000000000000000E1
r2 = 0.200000000000000000000000000000000000000000000000000000000000E1

Using mpfr_pow
r1^r2 = 0.400000000000000000000000000000000000000000000000000000000000E1

Using mpfr_pow_ui
r1^2 = 0.400000000000000000000000000000000000000000000000000000000000E1
  ok

--
KM

=== begin code ===
include ans-words
include modules
include syscalls
include mc
include asm
include strings
include lib-interface
include libs/gmp/libmpfr
include libs/gmp/mpfr-utils

DECIMAL

256 mpfr_set_default_prec  \ provides 77 sig. decimal digits
mpfr_t r1
mpfr_t r2
mpfr_t dst
r1  mpfr_init
r2  mpfr_init
dst mpfr_init

cr
cr .( 2^3) cr
r1 2 GMP_RNDN  mpfr_set_ui  drop
r2 3 GMP_RNDN  mpfr_set_ui  drop
.( r1 = ) r1 60 mpfr. cr
.( r2 = ) r2 60 mpfr. cr

cr .( Using mpfr_pow) cr
dst r1 r2 GMP_RNDN mpfr_pow drop
.( r1^r2 = ) dst 60 mpfr. cr

cr .( Using mpfr_pow_ui) cr
dst r1 3 GMP_RNDN mpfr_pow_ui drop
.( r1^3 = ) dst 60 mpfr. cr

cr .( 2^2) cr
r2 2 GMP_RNDN mpfr_set_ui drop
.( r1 = ) r1 60 mpfr. cr
.( r2 = ) r2 60 mpfr. cr

cr .( Using mpfr_pow) cr
dst r1 r2 GMP_RNDN mpfr_pow drop
.( r1^r2 = ) dst 60 mpfr. cr

cr .( Using mpfr_pow_ui) cr
dst r1 2 GMP_RNDN mpfr_pow_ui drop
.( r1^2 = ) dst 60 mpfr. cr
=== end code ===

Technical Details
Message-ID: <11b4t9g$204qr$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <11b2su5$229je$1@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Krishna Myneni <krishna.myneni@ccreweb.org>
Newsgroups: comp.lang.forth
Subject: Re: bug in mpfr-3.1.0
Date: Mon, 19 Oct 2026 06:01:02 -0500
Organization: A noiseless patient Spider
Lines: 91
Message-ID: <11b4t9g$204qr$1@dont-email.me>
References: <11b2su5$229je$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 19 Oct 2026 11:01:05 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="2102107"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19FVO58pccYiPC40iNdd5iT"; posting-host="53448866990c10d050150d317b8d863b"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:cL+xvxX4Kg5wJvZr5ZVrSwH3Y8k= sha256:ThFBsdCIWeswFXSH+H56KvtYbxNLMSzms9t2ryIK6gY=
	sha1:NCanUNEAmk+HaOHdYEATrleDuQo= sha256:2+PCRnKXXGmDFFHfjMSOyb27IFk+yGTIKCn/LNeK/Js=
In-Reply-To: <11b2su5$229je$1@dont-email.me>
Content-Language: en-US