MATLAB Answers

how to use mod in variable that have big value

11 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??

  0 Comments

Sign in to comment.

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

zikrullah muhammad
zikrullah muhammad on 21 Jun 2011
thats mean i can use this code?
any sugestion? or other way to do that?
thank a lot for you answer
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)

Sign in to answer this question.

Tags