The swift operator uses the _02_swift base data type

Source: Internet
Author: User
Tags arithmetic operators

//: Playground-noun:a Place where people can playImport UIKit//the use of the----------operator---------//1. Assignment OperatorsvarA =0varb =1//The assignment operator does not return a value and cannot be used as a condition to determine the manifestation of swift securityb =a//2. Arithmetic OperatorsLet sum =9+4Let min=9-4Let mul=9*4Let div=9/4Let mod=9%4//The remainder operator can be used for floating-point numbersLet mod2 =8.0%2.5//self-increment self-reduction//Unary minus operatorLet C =3varMINUSB =-C//3. Compound Assignment OperatorsvarD =4D+=5//c = b + = 1//if B = a {//    //    //}//4. Comparison Operators//5. Logical OperatorsvarMale =false//take non-operators only for expressions of type boolif!Male {print ("She's a girl .")}//6. Three mesh operatorvarisreweeted =true;varFontSize = isreweeted? the: - //grammatical requirements? There must be a space in front

Swift operator uses _02_swift base data type

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.