how to use mod in variable that have big value

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

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

thats mean i can use this code?
any sugestion? or other way to do that?
thank a lot for you answer
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.
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!