Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: Displaying large Integers

Subject: Displaying large Integers

From: Daniel

Date: 19 Feb, 2008 00:35:03

Message: 1 of 3

I read all the formating stuff on matlabs site but cant
figure out how to display large integers without them being
E to the X.

I need to display my data as

901276736291

And not as

1.0e+011 * 9.01276736291000

Thanks for any help in advance.

Subject: Re: Displaying large Integers

From: Roger Stafford

Date: 19 Feb, 2008 02:28:02

Message: 2 of 3

"Daniel " <daw4888@hotmail.com> wrote in message <fpd87m$agl
$1@fred.mathworks.com>...
> I read all the formating stuff on matlabs site but cant
> figure out how to display large integers without them being
> E to the X.
>
> I need to display my data as
>
> 901276736291
>
> And not as
>
> 1.0e+011 * 9.01276736291000
>
> Thanks for any help in advance.
---------
  Use the %.0f format of fprintf.

 x = 9876^3;
 fprintf('%.0f\n',x)

963259373376

Subject: Re: Displaying large Integers

From: Yumnam Kirani Singh

Date: 19 Feb, 2008 05:19:37

Message: 3 of 3

Another alternative is using sprintf as
>>sprintf('%f', x)
But the thing is matlab cannot display more than 17 decimal digits. All other digits after 17th digit will be displayed as zero. You have to write your own code to dispaly large numbers if the number is more than a 17 digit number.

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics