immutable class CARD < $CARDINAL{CARD}, $OPTION, $EXACT_FMT |
---|
**** |
________This_immutable_class_is_one_of_the_most_fundamental_exact_number ___classes.__It_has_the_value_domain_from_0_to_some_maximum_value_determined ___by_the_machine_representation_provided.___All_arithmetic_on_values_of_this ___class_is_unsigned,_whether_involving_overflow_detection_or_modular ___operations.__This_class_inherits_from_AVAL{BIT}._The_number_of_bits ___in_the_representation_is_identical_to_NUM_BITS::Num_Bits. ___NOTE_The_Sather_language_requires_that_Num_Bits_be_at_least_32_to_ensure ________portability_of_INT_literals_up_to_this_size. ________Many_of_the_operations_are_specified_to_raise_exceptions_on_overflow. ___They_are,_however,_only_guaranteed_to_do_this_if_checking_is_enabled! ___Enabling_checking,_however,_may_affect_performance._Certain_machines_with ___appropriate_hardware_may_perform_these_checks_even_when_checking_is_not ___enabled. ___References_: ________Keith_O._Geddes,_Stephen_R._Czapor,_and_George_Labahn,_"Algorithms ________for_Computer_Algebra",_Kluwer_Academic_Publishers,_Boston,_1992. |
const Num_Bits : CARD := asize ; .. Included as Num_Bits |
---|
const is_exact : BOOL := true ; .. Included as is_exact |
---|
const is_limited : BOOL := true ; .. Included as is_limited |
---|
const is_signed : BOOL := false ; .. Included as is_signed |
---|
const one : SAME := 1 ; .. Included as one |
---|
const two : SAME := 2 ; .. Included as two |
---|
const zero : SAME := 0 ; .. Included as zero |
---|
**** | See $NFE |
abs : SAME |
---|
aget( .. Included as aget |
---|
aset( .. Included as aset |
---|
binstr : BINSTR .. Included as binstr |
---|
build( .. Included as build |
---|
build( .. Included as build |
---|
build_based( .. Included as build_based |
---|
card : SAME |
---|
**** | This routine returns a copy of self. Built-in to this implementation. |
ceiling(other : SAME) : SAME .. Included as ceiling |
---|
create(str : BINSTR) : SAME .. Included as create |
---|
create(val : CARD) : SAME |
---|
create(val : FIELD) : SAME |
---|
create(val : FLT) : SAME .. Included as create |
---|
create(val : FLTD) : SAME .. Included as create |
---|
create(val : INT) : SAME .. Included as create |
---|
create(val : INTI) : SAME .. Included as create |
---|
create(val : QUADBITS) : SAME |
---|
**** | This returns a cardinal value from the given bit-pattern. |
create(val : RAT) : SAME .. Included as create |
---|
create( .. Included as create |
---|
cube : SAME .. Included as cube |
---|
decimal_str( .. Included as decimal_str |
---|
decimal_str( .. Included as decimal_str |
---|
decimal_str( .. Included as decimal_str |
---|
decimal_str : STR .. Included as decimal_str |
---|
div(other : SAME) : SAME |
---|
evenly_divides(other : SAME) : BOOL .. Included as evenly_divides |
---|
**** | This predicate returns true if and only if self is an exact divisor of other. |
exp10 : SAME .. Included as exp10 |
---|
exp2 : SAME .. Included as exp2 |
---|
extended_gcd(other : SAME, out self_factor, out i_factor : SAME) : SAME .. Included as extended_gcd |
---|
factorial : SAME .. Included as factorial |
---|
field : FIELD |
---|
**** |
________This_routine_returns_a_copy_of_self.__Built-in_to_this_implementation. |
flt : FLT .. Included as flt |
---|
fltd : FLTD .. Included as fltd |
---|
fmt( .. Included as fmt |
---|
fmt( .. Included as fmt |
---|
gcd(other : SAME) : SAME .. Included as gcd |
---|
hash : CARD .. Included as hash |
---|
**** |
hex_create(str : STR) : SAME |
---|
hex_str( .. Included as hex_str |
---|
hex_str( .. Included as hex_str |
---|
hex_str( .. Included as hex_str |
---|
hex_str : STR .. Included as hex_str |
---|
in_range(lower, upper : SAME) : BOOL .. Included as in_range |
---|
**** | This predicate returns true if and only if self has a value between
___lower_and_upper_inclusive.__Built-in_to_this_implementation. |
in_range(rng : $RANGE{XTP}) : BOOL .. Included as in_range |
---|
**** | This predicate returns true if and only if self has a value within
___the_given_range. |
in_tolerance(tolerance, val : SAME) : BOOL .. Included as in_tolerance |
---|
**** | This predicate returns true if and only if self is within the given
___tolerance_of_val. |
int : INT |
---|
inti : INTI .. Included as inti |
---|
is_card(str : STR) : BOOL |
---|
**** | This predicate returns true if and only if str represents a cardinal
___number_in_decimal_notation. |
is_eq( .. Included as is_eq |
---|
is_eq(other : $OB) : BOOL .. Included as is_eq |
---|
**** | This is the generic equality predicate. c.f. the class $IS_EQ |
is_even : BOOL .. Included as is_even |
---|
**** | This predicate returns true if and only if self is an even valued number. |
is_exp2 : BOOL .. Included as is_exp2 |
---|
**** | This predicate returns true if and only if self is a power of two. |
is_hex( .. Included as is_hex |
---|
is_lt( .. Included as is_lt |
---|
is_nil : BOOL .. Included as is_nil |
---|
**** | This predicate returns true if and only if self is nil. |
is_octal( .. Included as is_octal |
---|
is_odd : BOOL .. Included as is_odd |
---|
**** |
__This_predicate_returns_true_if_and_only_if_self_is_an_odd_valued_number. |
is_pos : BOOL .. Included as is_pos |
---|
**** | This predicate returns true if and only if self is greater than zero. |
is_prime : BOOL |
---|
**** | This predicate returns true if and only if self is a prime number. |
is_prime_to(other : SAME) : BOOL .. Included as is_prime_to |
---|
**** | This predicate returns true if and only if self is relatively prime to other. |
is_zero : BOOL .. Included as is_zero |
---|
**** | This predicate returns true if and only if self is zero. |
lcm(other : SAME) : SAME .. Included as lcm |
---|
log2 : SAME |
---|
max(other : SAME) : SAME .. Included as max |
---|
maxval : SAME .. Included as maxval |
---|
middle(first, second : SAME) : SAME .. Included as middle |
---|
min(other : SAME) : SAME .. Included as min |
---|
minus(other : SAME) : SAME |
---|
minval : SAME .. Included as minval |
---|
mod(other : SAME) : SAME |
---|
next_exp2 : SAME |
---|
nil : SAME .. Included as nil |
---|
**** | This routine returns the value to be used to represent nil. This is the value maxval in this implementation. |
num_chars : CARD .. Included as num_chars |
---|
oct_create(str : STR) : SAME |
---|
oct_str( .. Included as oct_str |
---|
oct_str : STR .. Included as oct_str |
---|
plus(other : SAME) : SAME |
---|
pow(power : SAME) : SAME .. Included as pow |
---|
**** | pre (power < (maxval / self)) post true -- better one?? |
rat : RAT .. Included as rat |
---|
read(index : BIN_CURSOR) : SAME .. Included as read |
---|
sign : NUM_SIGNS .. Included as sign |
---|
sqrt : SAME .. Included as sqrt |
---|
square : SAME .. Included as square |
---|
str( .. Included as str |
---|
str : STR .. Included as str |
---|
str_base(b:SAME):STR |
---|
**** | str in base b for debug |
times(other : SAME) : SAME |
---|
write(fyle : BIN_FILE) .. Included as write |
---|
aelt!( .. Included as aelt! |
---|
aelt!( .. Included as aelt! |
---|
aelt!( .. Included as aelt! |
---|
aelt! : BOOL .. Included as aelt! |
---|
**** | This iter is effectively a predicate which yields true or false
___depending_upon_whether_the_indicated_bit_of_self_was_set_or_not. |
aind! : CARD .. Included as aind! |
---|
binary!(once limit : SAME) : SAME .. Included as binary! |
---|
downto!(once limit : SAME) : SAME .. Included as downto! |
---|
for!(once cnt : SAME) : SAME .. Included as for! |
---|
product!(other : SAME) : SAME .. Included as product! |
---|
step!(once cnt : CARD, once step : INT) : SAME .. Included as step! |
---|
stepto!(once to : SAME, once by : INT) : SAME .. Included as stepto! |
---|
sum!(other : SAME) : SAME .. Included as sum! |
---|
times! .. Included as times! |
---|
times! : SAME .. Included as times! |
---|
up! : SAME .. Included as up! |
---|
upto!(once limit : SAME) : SAME .. Included as upto! |
---|
uptoward!(once limit : SAME) : SAME |
---|
**** |
__This_iter_yields_successive_numbers_self<=result<limit. |
const Decimal_Base : CARD := 10 ; .. Included as Decimal_Base |
---|
const Default_Base : CARD := Decimal_Base ; .. Included as Default_Base |
---|
const Hexadecimal_Base : CARD := 16 ; .. Included as Hexadecimal_Base |
---|
const Max_Power : SAME := 19 ; .. Included as Max_Power |
---|
**** | temporary fixed value |
const Octal_Base : CARD := 8 ; .. Included as Octal_Base |
---|
const asize : CARD := NUM_BITS::Num_Bits ; .. Included as asize |
---|
do_build( .. Included as do_build |
---|
is_kind( .. Included as is_kind |
---|
is_legal_aelts_arg( .. Included as is_legal_aelts_arg |
---|
is_whole( .. Included as is_whole |
---|
p_str:STR |
---|
scan( .. Included as scan |
---|
zero_filled( .. Included as zero_filled |
---|