954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

modululs equivalent for large numbers?

Hi,

I have a program that needs to perform billions of loops. I want to print out something to the screen for every certain number of iterations (ie let's say 1 million). Because % is only suposed to work for integers, how do I get the equivalent functionality with long double?

Thanks,
Winbatch

winbatch
Posting Pro in Training
466 posts since Feb 2005
Reputation Points: 68
Solved Threads: 18
 

fmod() can be used with doubles. perhaps your compiler has an fmod that accepts long doubles too.

Stoned_coder
Junior Poster
164 posts since Jul 2005
Reputation Points: 19
Solved Threads: 5
 

I'm using doubles for now (fmod is working nicely). Thanks.

winbatch
Posting Pro in Training
466 posts since Feb 2005
Reputation Points: 68
Solved Threads: 18
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You