Answers for "~/ vs / dart"

0

~/ 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');
Posted by: Guest on December-23-2020

Code answers related to "Dart"

Browse Popular Code Answers by Language