[scilab-Users] Re: format(): limit of the number of digits

Mike Page Mike at Page-One.Waitrose.com
Thu Mar 1 17:55:35 CET 2012


Thanks Adrien,

I didn't know about these packages.  Certainly mpscilab (if it works) should
solve Jonas' problem.  It would appear to implement the sort of scheme I was
talking about.  Maybe Jonas could try it out and report back with some
results?

Cheers,
Mike.

  -----Original Message-----
  From: Adrien Vogt-Schilb [mailto:vogt at centre-cired.fr]
  Sent: 01 March 2012 13:45
  To: users at lists.scilab.org
  Subject: Re: [scilab-Users] Re: format(): limit of the number of digits


  There are also
  http://atoms.scilab.org/toolboxes/dbldbl   : for double double precision,
maintained by a member of the scilab team, and

  http://atoms.scilab.org/toolboxes/DD_QD which says it goes as far as
quadruple double precision.

  Hope one of these helps

  On 01/03/2012 14:40, Adrien Vogt-Schilb wrote:
    Hi

    I am not sure, but maybe this toolbo may help
    http://atoms.scilab.org/toolboxes/mpscilab

    It says it is for arbitrary precision calculus.


    On 01/03/2012 13:09, Mike Page wrote:
Hi Jonas,

I don't think you can do that.  The longest native integer type is (AFAIK)
32 bits.  This will only hold about 9 decimal digits.  So the result of
factorial 24 in integer form would be an overflow.

-->i=int32(factorial(24))
 i  =

 -2147483648

while
-->i=int32(factorial(12))
 i  =

  479001600
works correctly and is the limit of how far you can get with an integer
type.

As I mentioned before, the only way I know to go beyond these limits is to
do your own arithmetic with a structured type holding the extended words of
the data.  If your arithmetic is complicated, then this would be hard.
Maybe Scilab is not the best tool for your purposes?  You can find some
information about this problem in Wikipedia
(http://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic).

HTH
Mike.


-----Original Message-----
From: jonas [mailto:jonathanattia at gmail.com]
Sent: 01 March 2012 11:50
To: users at lists.scilab.org
Subject: [scilab-Users] Re: format(): limit of the number of digits


Thank you for your post.

This syntax/function is valid for a floating-point number.
How can I get a high number of digits for a positive integer?

Here's a numerical example: factorial(24) = 6.204484017332394100D+23

Thank you in advance.

Best regards,
Jonas.

--
View this message in context:
http://mailinglists.scilab.org/format-limit-of-the-number-of-digits-tp378838
0p3790178.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at
Nabble.com.

--
To unsubscribe from this mailing-list, please send an empty mail to
users-unsubscribe at lists.scilab.org
To check the archives of this mailing list, see
http://mailinglists.scilab.org/


--
To unsubscribe from this mailing-list, please send an empty mail to
users-unsubscribe at lists.scilab.org
To check the archives of this mailing list, see
http://mailinglists.scilab.org/



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20120301/5b449adb/attachment.htm>


More information about the users mailing list