If I've have these numbers and I they can be used or not (they relate to on off switches )
How can I write a program to work out which combination will get closest to a given number up to 128 ?
The letters are just there to label the switches
Thanks
64 A
32 B
16 C
8 D
4 E
2 F
1 G
0.5 H
0.25 I
0.125 J
0.0625 K
0.03125 L
0.015625 M
0.0078125 N
How can I write a program to work out which combination will get closest to a given number up to 128 ?
The letters are just there to label the switches
Thanks
64 A
32 B
16 C
8 D
4 E
2 F
1 G
0.5 H
0.25 I
0.125 J
0.0625 K
0.03125 L
0.015625 M
0.0078125 N