ASP comparison operators logical operators

Source: Internet
Author: User
Tags integer division
Http://www.tizag.com/aspTutorial/aspOperators.php

ASP Arithmetic Operators

The mathematical operators in ASP are similar to your other programming languages. However, ASP does not support using cut operators like ++, --, ++ =, etc.

operator English example result
+ addition mynum = 3 + 4 mynum = 7
- subtraction mynum = 4-1 mynum = 3
* multiplication mynum = 3*2 mynum = 6
/ Division mynum= 9/3 mynum = 3
^ exponential mynum = 2 ^ 4 mynum = 16
mod modulus mynum = 23 mod 10 mynum = 3
- negation mynum =-10 mynum =-10
\ Integer Division mynum = 9 \ 3 mynum = 3
Comparison Operators

Comparison operators are used when you want to compare two values to make a demo. comparison operators are most commonly used in conjunction with "if... then "and" while something is true do this... "statements, otherwise known as conditional statements. the items that are most often compared are numbers. the result of a comparison operator is either true or false.

Operator English Example Result
= Equal 4 = 3 False
< Less 4 <3 False
> Greater 4> 3 True
<= Less than or equal 4 <= 3 False
> = Greater than or equal 4> = 3 True
<> Not equal 4 <> 3 True
Logical operators

The above comparison operators result in a truth value of true or false. A logical operator is used for complex statements that must make decisions based on one or more of these trese values.

Operator English Example Result
And Both must be true True and false False
Or One must be true True or false True
Not Flips truth value Not true False
String Operators

The only string operator is the String concatenation operator "&" that takes two strings and slams them together to form a new string. an example wocould be string1 = "Tim" and string2 = "is a hero ". the following code wocould combine these two strings into one: string3 = string1 & string2

Operator English Example Result
& String concatenation String4 = "Bob" & "runs" String4 = "Bob runs"

We will be using these operators throughout the tutorial, so chances are you will get understand them more and more as this tutorial goes on.

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.