[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Disable Scientific Notation when using num2str function
From: |
Jordi Gutiérrez Hermoso |
Subject: |
Re: Disable Scientific Notation when using num2str function |
Date: |
Tue, 30 Oct 2012 13:15:37 -0400 |
On 30 October 2012 12:12, bobkarh <address@hidden> wrote:
> Whoa, found a way myself!!!!
>
> instead of using "num2str" I can use "int2str", and sorted
No, you need to understand *why* neither of them can work:
octave:1> int2str(12345678901234567890)
ans = 12345678901234567168
Octave cannot represent arbitrary-precision integers. When you type
12345678901234567890 into the interpreter, it's parsed as a
double-precision number, then int2str is called on the result. You
will always hit a precision limit this way. If you need something like
arbitrary precision arithmetic, use a CAS like Maxima or Sage.
- Jordi G. H.