Last active
April 20, 2021 08:00
-
-
Save davidmigloz/22ae4bce721578c8b1cca5c81396c2e7 to your computer and use it in GitHub Desktop.
Dart vs Kotlin: arithmetic operators
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
var addition = 3 + 2; // 5 | |
var subtraction = 3 - 2; // 1 | |
var negation = -1; // -1 | |
var multiplication = 3 * 2; // 6 | |
var division = 3 / 2; // 1.5 | |
var integerDivision = 3 ~/ 2; // 1 | |
var modulo = 3 % 2; // 1 | |
modulo++; // 2 | |
modulo--; // 1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main() { | |
var addition = 3 + 2 // 5 | |
var subtraction = 3 - 2 // 1 | |
var negation = -1 // -1 | |
var multiplication = 3 * 2 // 6 | |
var division = 3.0 / 2 // 1.5 | |
var integerDivision = 3 / 2 // 1 | |
var modulo = 3 % 2 // 1 | |
modulo++ // 2 | |
modulo-- // 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment