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 ]
Wanderson

Posts: 25
Registered: 10/3/11
Re: Precision after division
Posted: Jun 12, 2013 9:47 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Nasser M. Abbasi" wrote in message <kpb6hl$a41$1@speranza.aioe.org>...
> On 6/12/2013 7:39 PM, Wanderson wrote:
> > 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.
> >

>
> one way
>
> ---------------
> r= '2147483647/11';
> vpa(r,100)
>
> 195225786.09090909090909090909090909090909090909090909090 etc...
> -----------------
>
> or
>
> -------------------
> r= 2147483647/11;
> num2strexact(r)
>
> 1.952257860909090936183929443359375e8
> --------------
>
> or
>
> --------------------------
> format long
> r
>
> 1.952257860909091e+08
> -------------------------
>
>
> --Nasser


rsrs, 'one way' (:

Thanks a lot Nasser, I'll help me for sure.



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.