Features
Ask DevGuru
ASP Resources
Find the Bug
Knowledge Base
Links
Tips of the Week
Tutorials
Products
dgCalendar
dgCharge New!
dgChart New!
dgFileUpload
dgReport New!
dgSort
dgTree
Site
Authoring
Coming Soon
DevGuru Resume
Link to Us
Merchandise
Sponsorships
Testimonials
What's New
Technologies
ADO 2.6
ASP
CSS2
HTML
JavaScript
Jet SQL
Transact-SQL Syntax
VBScript
WML
WMLScript
WSH
XML DOM
All Operators
OPERATOR: Mod
Implemented in version 1.0
Mod
The
Mod
operator divides two numbers and returns the remainder.
In the example, 5 divides into 26, 5 times, with a remainder of 1.
Code:
<% remainder = 26 Mod 5 %>
Output:
1
Note that for floating-point numbers, the numbers to the right of the decimal are simply ignored (i.e., in the example, 5.7176 is treated as 5 by
Mod
).
Code:
<% remainder = 26.1234 Mod 5.7176 %>
Output:
1
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information