[Scilab-users] Problems arising from truncation of %pi

Samuel Gougeon sgougeon at free.fr
Sat Jan 9 13:04:23 CET 2021


Hello Federico,

Le 09/01/2021 à 01:32, Federico Miyara a écrit :
>
> Jean-Yves,
>
>>> sin(x - n*pi)
>> So now the problem can be how these large numbers are obtained
>> --> a=1e16+1
>> --> a-1e16
>> of course equals zero.
>
> Yes, I've thought about it and you are right, above 1e16 x is so 
> sparse, cycle-wise speaking, that my original intention doesn't make 
> much sense.


MPScilab <https://atoms.scilab.org/toolboxes/MPScilab> is an external 
module available up to Scilab 5.3 -- not recompiled since then -- 
allowing *arbitrary precision computations* for a short list 
<http://forge.scilab.org/index.php/p/mpscilab/source/tree/master/mpscilab/help/en_US> 
of the mathematical functions.
sin() is not in the list, but exp() is. So if this release supports 
complex input arguments, Euler formulae should be usable to comput 
trigonometric functions as well in arbitrary precision.

Unlike MPScilab, DD_QD <https://atoms.scilab.org/toolboxes/DD_QD> is 
available for Scilab 6.1. It implements floating point computations for 
decimal numbers encoded over 2x8 or 4x8 bytes, instead of "only" 8 bytes.
sin(), cos() and tan() are among supported functions.

You may try them out, out of curiosity.

Regards
Samuel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20210109/66fbd0b9/attachment.htm>


More information about the users mailing list