Can someone explain to me how
printf("%d", -2<2u?1:-1);
outputs "-1". I assume that some implicit conversion is occurring, but I cannot understand it.
-2 converts to unsigned integer . This will be equal to UINT_MAX - 1 , which is definitely more than 2 . Consequently, the condition fails and -1 is printed.
-2
unsigned integer
UINT_MAX - 1
2
-1
Source: https://habr.com/ru/post/1242865/More articles:Java Netbeans: "Package does not exist" - javaAndroid Studio java.util.zip.ZipException: duplicate recording - androidToken revocation for observable - c #Getting all Wikipedia articles with coordinates inside London - pythonhttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1242864/linq-tolist-fails-to-trigger-immediate-execution&usg=ALkJrhjnsTwCil8xLE2l31uGfKMg0MMuSgConvert Swift 2 closures to Objective-C block - closuresSetting up Google Calendar API - oauthWhat does an asterisk mean in front of a colored CSS background? - htmlSpriteKit SKPhysicsBody script in one direction, like a door, you can go through but not come back - iosHow to pass result from modal angular -ui-bootstrap to parent without closing? - angularjsAll Articles