The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM 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: 18,038
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 " <> wrote in message
> 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
To contact Technical Support use the Contact Us link on

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2017. All Rights Reserved.