# Section 7.2.1:
BIT

###### immutable class BIT

#### Formal Types

types
SAME = BIT ;
BIT = token

See also the Required Library class BIT which provides conversion routines to convert from a cardinal number to a bit value and vice versa.

NOTE | This class is defined in such a way that an implementation is not required to specify in what way the object is implemented. Any use which attempts to rely on some particular representation is erroneous.

#### is_eq

This predicate provides the operation of equality testing. It is suitable for use in infix logical expressions.

is_eq | (
| other : SAME
| : BOOL

##### Formal Signature

is_eq(self : SAME, other : SAME) res : BOOL

##### Post-condition

post res = (self = other)

This predicate returns true if and only if self and other have the same value, otherwise false.

#### set

This predicate provides the ability to test if self is a setbtit or a clearbit.

set | : BOOL

##### Formal Signature

set(self : SAME) res : BOOL

##### Post-condition

post res = (self = setbit)

This predicate returns true if and only if self has the value setbit, otherwise false.

#### clear

This feature provides the ability to test if self is a clearbit or a setbit.

clear | : BOOL

##### Formal Signature

clear(self : SAME) res : BOOL

##### Post-condition

post res = (self = clearbit)

This predicate returns true if and only if self has the value clearbit, otherwise false.

| Language Index |  | Library Index |  | Section 7 Index

Comments or enquiries should be made to Keith Hopper . Page last modified: Thursday, 18 May 2000. |