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?


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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.