J
Jack Leach
Many constants in programming are defined with values that, when any
combination of their sum is procuded, will add to a unique number, for use in
contencating values to supply one or more constants by reading a single
value...
For instance, constants declared as 1, 2, 4, 8, 16, 32 etc can all be added,
in any combination, and each combination will produce a unique sum which will
tell which of the subset were added.
Two questions:
1) what is this concepted officially called?
2) is there an implementation standard for this? I assume that there's a
function already written somewhere that will take a given sum and break it
down to components.
I'm fairly certain I can figure this out on my own, shouldn't be all that
difficult, but I assume there is some standard method, and if so I would like
to adopt it.
Any pointers? Thanks,
--
Jack Leach
www.tristatemachine.com
"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
combination of their sum is procuded, will add to a unique number, for use in
contencating values to supply one or more constants by reading a single
value...
For instance, constants declared as 1, 2, 4, 8, 16, 32 etc can all be added,
in any combination, and each combination will produce a unique sum which will
tell which of the subset were added.
Two questions:
1) what is this concepted officially called?
2) is there an implementation standard for this? I assume that there's a
function already written somewhere that will take a given sum and break it
down to components.
I'm fairly certain I can figure this out on my own, shouldn't be all that
difficult, but I assume there is some standard method, and if so I would like
to adopt it.
Any pointers? Thanks,
--
Jack Leach
www.tristatemachine.com
"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)