Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of DigitCode by
Diff: fonction.cpp
- Revision:
- 0:163dfb02ed36
diff -r 000000000000 -r 163dfb02ed36 fonction.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/fonction.cpp Tue Apr 14 08:34:05 2015 +0000
@@ -0,0 +1,44 @@
+#include "fonction.h"
+int bitToInt(int i)
+{
+ switch (i) {
+ case 1:
+ return 0;
+ // break;
+ case 2:
+ return 1;
+ // break;
+ case 4:
+ return 2;
+ // break;
+ case 8:
+ return 3;
+ // break;
+ case 16:
+ return 4;
+ // break;
+ case 32:
+ return 5;
+ // break;
+ case 64:
+ return 6;
+ // break;
+ case 128:
+ return 7;
+ // break;
+ case 256:
+ return 8;
+ // break;
+ case 512:
+ return 9;
+ // break;
+ case 1024:
+ return -1;
+ // break;
+ case 2048:
+ return -2;
+ // break;
+ default:
+ return -3;
+ }
+}
\ No newline at end of file
