I'm not sure I have the latest in either books or compilers to do it
properly, so I thought I'd ask here. In concocting some GCD code for the
next SNIPPETS release, I came across a problem with template-based code that
required the use of the % operator. In C, I have to make type-specific
versions, so the function which works with doubles simply uses fmod() instead
of %. However, I'm kinda lost when it comes to writing a template-based
equivalent which will need to either use the % operator or call fmod()
depending on the type of its arguments and return value.
--- QM v1.00
---------------
* Origin: MicroFirm : Down to the C in chips (1:106/2000.6)
|