To clarify: to the best of my knowledge BSF4ooRexx does nothing that would 
explain this weird
behaviour on Linux. (It works as expected on Windows and MacOS.)

---rony

P.S.: Ruurd came up with the idea that maybe the Java virtual machine that gets 
loaded may cause
this effect on Linux (both, librxmath.so and libjvm.so, use sqrt from the 
runtime). Even if so, this
awkward behaviour in Rexx should not be a side-effect of using any other 
library together with Rexx.


On 25.07.2020 12:12, Ruurd Idenburg wrote:
> Running the attached script "rxmath.rex"  will yield a weird result on my 
> Linux (Mint 19.3, which
> is based on Ubuntu 18.04) when the RxCalcSqrt function is called from the 
> RXBSF.REX for a
> non-perfect square (129).
>
> The code in RXBSF.REX does only ::REQUIRE  BSF.CLS without using any of its 
> possibilities (unless
> some lines are uncommented) but in turn requires the Java library "libjvm.so"
>
> It looks like the ::REQUIRE causes the sqrt function to produce a different 
> outcome of the
> resulting floating point number.
>
> When I run the code on a Windows 10 machine, the results from RXBSF.REX are 
> correct. Rony Flatcher
> ran the scripts on Darwin (MacOS) and there the results were correct too.
>
> I included the pure Rexx ::ROUTINE my_sqrt (more or less copied from Walter 
> Pachl's rxm.cls on
> Rosetta.org) to verify that that works OK.
>
> Also before calling RXBSF.REX from rxmath.rex and after returning from 
> RXBSF.REX the results of
> the RxMath rxCalcSqrt function are OK again.
>
> Seems to me that RxMath should not be impacted by another ::REQUIRE (if that 
> is the case??).
>
> Anybody with more system experience has some thoughts on how to tackle this?
>
> Cheers,
>
> Ruurd
>
> P.S.
>
> I have now switched to the use of Walter Pachl's  very nice package (thanks 
> Walter) that you can
> find here:
>
> <http://rosettacode.org/wiki/Trigonometric_functions#ooRexx>



_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to