how to use mod in variable that have big value

2 views (last 30 days)
hi all, i have little problem here
how to use mod in variable that have big value??
ex:
u= 1.3447e+236 v= 345
then why when i use mod it's return zero??
mod(u,v)
am i make a mistake in my code??

Accepted Answer

Sean de Wolski
Sean de Wolski on 21 Jun 2011
No. You've hit the limits of double precision floating point arithmetic. You would want vpi, which is no longer available, or it might be possible with the symbolic math toolbox.
  3 Comments
Sean de Wolski
Sean de Wolski on 21 Jun 2011
No. It means working in double precision floating point will not get you a valid answer. You'll need to work with a class of operators that is not double precision floating point. The fixed-point toolbox (I've never used it) does that; the symbolic math toolbox does that, and John's vpi which is no longer available does that.
Sean de Wolski
Sean de Wolski on 21 Jun 2011
Fixed point doesn't appear to have mod or rem.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!