Vanguard Software
Forecasting & Planning Solutions
Home Products Solutions Services Customers Partners Company
 
Applying science to business management

contents.gifindex.gifprev1.gifnext1.gif

Zero-Fill Right Shift

Format: x >>> y

Arguments: (int) x, y Any integers

Returns: (int) The value of x with all bits shifted right y places

Description: This operator converts x from a floating-point number to a 32-bit integer, shifts all bits y places to the right, and then returns the result as a floating-point number.

The difference between Right Shift and Zero-Fill Right Shift is in how the sign bit is treated. With Right Shift, the sign is preserved by keeping the most significant bit unchanged. With Zero-Fill Right Shift, the most significant bit is set to zero.

Examples: 16>>>3 = 2  (10000 >>> 3 = 00010)

  12>>>2 = 3  (01100 >>> 2 = 00011)

  -12>>>2 = 1073741821  (sign is not preserved)

See Also: Right Shift, Left Shift, Bitwise And, Bitwise Or, Bitwise Exclusive Or, Bitwise Not

  Demand Planning  |  Financial Forecasting
Forecasting Software  |  Strategic Planning Software  |  Decision Tree Software
Decision Support Software  |  Expert System Software  |  Online Surveys

Contact Us  |  Terms of Use  |  Privacy Policy  |  Site Map
Vanguard Software
© 2011 Vanguard Software Corporation
Print this page   Email this page to a friend