Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

~/ vs / dart

assert(2 + 3 == 5);
assert(2 - 3 == -1);
assert(2 * 3 == 6);
assert(5 / 2 == 2.5); // Result is a double
assert(5 ~/ 2 == 2); // Result is an int
assert(5 % 2 == 1); // Remainder

assert('5/2 = ${5 ~/ 2} r ${5 % 2}' == '5/2 = 2 r 1');
Source by dart.dev #
 
PREVIOUS NEXT
Tagged: #dart
ADD COMMENT
Topic
Name
8+7 =