home > 比較編 > F#, Scala, Haskell > arithmetic and logic >

ForNext

Only Do What Only You Can Do

041. bit operators

VBScript

JScript

Perl

PHP

Python

Ruby

PowerShell

Scala

1 << 4
1 >> 4
1 & 3
1 | 3
1 ^ 3
~ 1



F#

OCaml

1 lsl 4
1 lsr 4
1 land 3
1 lor 3
1 lxor 3
lnot 1



Haskell

import Data.Bits
x = 1 :: Integer
y = 3 :: Integer
shiftL x 4
shiftR x 4
x .&. y
x .|. y
xor x y
complement x

C

C++

C++Builder

VC++

C#

Java

Objective-C

D

VB

VB.NET

Delphi

Ada

PL/SQL

T-SQL

inserted by FC2 system