pulling out 27
by atjurhs from LinuxQuestions.org on (#6H508)
hi guys,
i'm trying to figure out an algorithm for pulling out 27 from a larger integer. the value won't always be 27 (i'm just using that as an example), but it will always be user specified.
the larger integer will always be different (like 3027001 or 60027005 or 120027000) but the value 27 (or whatever the user specifies) will always occur in the thousand's position, and there will always be 2 or more digits past the 27, like in the examples.
i've tried various combinations of floor, ceiling, mod, trunc. none of which have worked. what would you try?
if it makes any difference, eventually the solution will become part of a c++ code but even psuedo-code would be helpful and appreciated!
thanks for your ideas/help!
oh, and if there is a better forum to post this thread, please let me know and i'll move it
Todd
i'm trying to figure out an algorithm for pulling out 27 from a larger integer. the value won't always be 27 (i'm just using that as an example), but it will always be user specified.
the larger integer will always be different (like 3027001 or 60027005 or 120027000) but the value 27 (or whatever the user specifies) will always occur in the thousand's position, and there will always be 2 or more digits past the 27, like in the examples.
i've tried various combinations of floor, ceiling, mod, trunc. none of which have worked. what would you try?
if it makes any difference, eventually the solution will become part of a c++ code but even psuedo-code would be helpful and appreciated!
thanks for your ideas/help!
oh, and if there is a better forum to post this thread, please let me know and i'll move it
Todd