class INTI < $WHOLE_NUM{INTI}, $SIGNED{INTI}, $VALUE_ITERS{INTI}, $EXACT_FMT |
---|
**** |
________This_class_implements_arbitrarily_large_integers.___An_integer_is ___represented_by_n_digits_to_a_base_B,_ie,_where_array_element_zero_is ___written_first_- ________x_=_sign_*_(x[0]_+_x[1]*B_+_..._+_x[n-2]*B^(n-2)_+_x[n-1]*B^(n-1)) ________The_n_digits_x[i]_of_x_are_held_in_an_array_with_asize_>=_n._The ___sign_and_n_are_encoded_in_a_private_feature_len,_with_the_following ___semantics_-- ________n_=_|len|,_sign_=_sign(len) ___the_value_0_is_represented_by_len_=_0 ________The_operations_div_(/)_and_mod_(%)_obey_the_following_rules ________x_=_(x/y)*y_+_x%y___and___0_<=_x%y_<_|y| ___NOTE_1.___Objects_of_this_class_behave_like_an_immutable_class_object. ________2.___WARNING_The_possibility_of_an_infinite_integer_reaching ________the_memory_limit_boundary_is_not_considered_in_setting_any_pre ________and_post_condition!! |
const is_exact : BOOL := true ; |
---|
const is_limited : BOOL := false ; |
---|
const is_signed : BOOL := true ; |
---|
abs : SAME |
---|
binstr : BINSTR |
---|
build(cursor : BIN_CURSOR) : SAME |
---|
card : CARD |
---|
ceiling(val : SAME) : SAME |
---|
cmp(other : SAME) : INT |
---|
create(val : CARD) : SAME |
---|
**** |
__This_routine_creates_an_INTI_from_the_given_cardinal_value. |
create(val : FIELD) : SAME |
---|
**** |
__This_routine_creates_an_INTI_from_the_given_field_value. |
create(val : FLT) : SAME |
---|
**** |
__Provided_that_val_is_an_integer_value,_this_routine_creates __an_equivalent_valued_INTI_object. |
create(val : FLTD) : SAME |
---|
**** |
__Provided_that_val_is_an_integer_value,_this_routine_creates __an_equivalent_valued_INTI_object. |
create(val : INT) : SAME |
---|
**** |
__This_routine_creates_an_INTI_from_the_given_integer_value. |
create(val : INTI) : SAME |
---|
**** |
__This_routine_returns_the_argument_--_a_vacuous_routine. |
create(val : RAT) : SAME |
---|
**** |
__This_routine_creates_an_INTI_from_the_given_rational_value, __using_the_value_rounded_to_the_nearest_whole_number. |
cube : SAME |
---|
div(other:CARD): SAME |
---|
div(other:INT): SAME |
---|
div(other : SAME) : SAME |
---|
evenly_divides(val : SAME) : BOOL |
---|
**** |
__This_predicate_returns_true_if_and_only_if_there_is_no_remainder_when __dividing_self_by_val. |
exp10 : SAME |
---|
exp2 : SAME |
---|
extended_gcd(other:SAME, out f1, out f2:SAME):SAME |
---|
factorial : SAME |
---|
field : FIELD |
---|
flt : FLT |
---|
fltd : FLTD |
---|
gcd(other : SAME) : SAME |
---|
hash : CARD |
---|
in_range(lower, upper : SAME) : BOOL |
---|
**** |
__true_if_and_only_if_lower<=_self_<=_upper. |
in_range(rng : $RANGE{INTI} ) : BOOL |
---|
**** |
__This_predicate_returns_true_if_and_only_if_self_has_a_value_within_the_given_range. |
in_tolerance(tolerance, val : SAME ) : BOOL |
---|
**** |
__This_predicate_returns_true_if_and_only_if_self_is_within_the_given_tolerance_of_val. |
int : INT |
---|
inti : INTI |
---|
is_eq(other : SAME) : BOOL |
---|
**** |
__This_predicate_returns_true_if_and_only_if_self_and_other_have_the_same_value. |
is_even : BOOL |
---|
**** |
________This_predicate_returns_true_if_and_only_if_self_is_an_even_number. |
is_exp2 : BOOL |
---|
is_fpsp(base : INTI) : BOOL |
---|
**** |
__This_routine_returns_true_if_and_only_if_self_is_either_prime_or __Fermat's_pseudo-prime_of_the_given_base. |
is_lt(other : SAME) : BOOL |
---|
**** |
__This_predicate_returns_true_if_and_only_if_self_is_less_than_other. |
is_neg : BOOL |
---|
**** |
__This_predicate_returns_true_if_and_only_if_self_is_less_than_zero. |
is_nil : BOOL |
---|
**** |
__This_predicate_returns_true_if_and_only_if_self_has_the_value_nil. |
is_non_neg : BOOL |
---|
is_non_pos : BOOL |
---|
is_non_zero : BOOL |
---|
is_odd : BOOL |
---|
**** |
__This_predicate_returns_true_if_and_only_if_self_is_an_odd_number. |
is_one:BOOL |
---|
is_pos : BOOL |
---|
**** |
__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. __This_is_not_a_fast_implementation! |
is_prime_to(other : SAME) : BOOL |
---|
**** |
__This_predicate_returns_true_if_and_only_if_self_is_relatively_prime_to_other. |
is_zero : BOOL |
---|
**** |
__This_predicate_returns_true_if_and_only_if_self_is_zero. |
lcm(other : SAME) : SAME |
---|
log2 : INTI |
---|
max(other : SAME) : SAME |
---|
middle(first, second : SAME) : SAME |
---|
min(other : SAME) : SAME |
---|
minus(other:CARD): SAME |
---|
minus(other:INT): SAME |
---|
minus( other : SAME ) : SAME |
---|
mod(other:CARD): SAME |
---|
mod(other:INT): SAME |
---|
mod(other : SAME) : SAME |
---|
negatable : BOOL |
---|
**** |
__This_predicate_returns_true_if_and_only_if_this_class_is_numeric_and __negatable_--_trivially_true! |
negate : SAME |
---|
nil : SAME |
---|
**** |
__This_routine_returns_a_nil_value_which_may_not_be_used_in_arithmetic. |
one : SAME |
---|
**** |
__This_is_a_'constant'_of_the_value_1! |
plus(other:CARD): SAME |
---|
plus(other:INT): SAME |
---|
plus( other : SAME ) : SAME |
---|
pow(other:CARD): SAME |
---|
pow(other:INT): SAME |
---|
pow(exp : SAME ) : SAME |
---|
rat : RAT |
---|
sgn:SAME |
---|
**** | return int value of 1/0/-1 |
sign : NUM_SIGNS |
---|
sqrt : SAME |
---|
square : SAME |
---|
times(other:CARD): SAME |
---|
times(other:INT): SAME |
---|
times( other : SAME ) : SAME |
---|
two : SAME |
---|
**** |
__This_routine_returns_the_value_two. |
zero : SAME |
---|
**** |
__This_is_a_'constant'_of_the_value_0! |
downto!(once limit : SAME) : SAME |
---|
**** |
for!( once cnt : SAME ) : SAME |
---|
product!(other : SAME) : SAME |
---|
step!(once cnt : CARD, once step : INT ) : SAME |
---|
stepto!(once to : SAME, once by : INT) : SAME |
---|
sum!(other : SAME) : SAME |
---|
times! |
---|
times! : SAME |
---|
up! : SAME |
---|
upto!( once limit : SAME) : SAME |
---|
**** |