• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Work with all your cloud files (Drive, Dropbox, and Slack and Gmail attachments) and documents (Google Docs, Sheets, and Notion) in one place. Try Dokkio (from the makers of PBworks) for free. Now available on the web, Mac, Windows, and as a Chrome extension!


Digit Mask

This version was saved 13 years, 3 months ago View current version     Page history
Saved by Kenneth Finnegan
on August 28, 2008 at 11:27:00 pm

The original usage for this macro was for converting integers to a string, which is better served by sprintf, but there may be other uses for it. 





#define MASKDIGIT(digitnum, n)  (n/pow(10, digitnum) - (n/pow(10,digitnum+1)*10))



This macro could be used if you're expecting to return multiple single digit numbers from a function.







Comments (0)

You don't have permission to comment on this page.