Skip to content

Commit befd69c

Browse files
author
Jason L Perry
committed
Bitshift for Dart
1 parent b2be89d commit befd69c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dart/bin/lcd.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import 'dart:io';
33
import 'dart:math';
44

55
class LCD {
6-
static const List<int> TABLE = const [119, 36, 93, 109, 46, 107, 123, 37, 127, 111];
6+
static const List<int> TABLE = const [119, 36, 93, 109, 46, 107, 123, 37, 127, 111]; // Binary notation is not available in Dart.
77
static const String H_SYM = "-";
88
static const String V_SYM = "|";
99
static const String S_SYM = " ";
@@ -20,7 +20,7 @@ class LCD {
2020
}
2121

2222
bool test(int number, int position) {
23-
return (TABLE[number] & pow(2, position)) > 0;
23+
return (TABLE[number] & (1 << position)) > 0;
2424
}
2525

2626
void draw() {

0 commit comments

Comments
 (0)