Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Precision after division
Replies: 3   Last Post: Jun 13, 2013 9:40 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Steven Lord

Posts: 17,944
Registered: 12/7/04
Re: Precision after division
Posted: Jun 13, 2013 9:40 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply



"Wanderson " <wanderson.ferreira@usp.br> wrote in message
news:kpb4bd$n4p$1@newscl01ah.mathworks.com...
> Hi,
>
> I was trying to implement an algorithm to check for prime numbers and I
> found an interesting question:
>
> Is possible to matlab calculate the division 2147483647/11 and return the
> decimals ? It is always rounded to 1.9523e+008, but I need the decimals
> place.


Are you just looking for the remainder? If so, don't do the division; just
use REM or MOD.

If you're looking for MATLAB to display the result with more decimal places
shown, look at the FORMAT function. The FORMAT function will not change how
the computations are _performed_ (they will be performed in double
precision) just how the result is _displayed._

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.