immutable class FLT < $REAL{FLT}, $OPTION, $FLT_FMT |
---|
**** |
________This_class_embodies_normal_arithmetic_(NOT_including_trigonometric) ___operations_on_a_floating_point_approximate_number_representation.___This ___has_been_chosen_to_be_the_single_32-bit_IEEE_754-1984_standard ___representation.___For_convenience_of_implementation,_most_of_the_operations ___are_done_in_terms_of_the_double_length_version_operations_for_portability. ___NOTE_1.___The_class_ANGLE_in_the_Geometric_section_of_this_library_has ________been_extracted_from_here_since_the_(inverse)_trigonometric_operations ________are_conversions_between_an_angle_domain_and_the_domain_of_numbers ________or_factors. ________2.___This_class_and_FLTD_are_exceptions_to_the_general_rule_in ________the_required_library_that_immutable_classes_all_inherit_from_$BINARY |
const Decimal_Multiplier : SAME := 10.0 ; |
---|
**** |
const Max_Precision : CARD := 6 ; |
---|
**** | digits before rounding problems |
const Num_Bits : CARD := 32 ; |
---|
**** | IEEE Single size numbers |
const digits : INT := 6 ; |
---|
**** | No of decimal digits of precn |
const double_inv_pi : SAME := FLTD::double_inv_pi.flt ; |
---|
**** | Approx 2/pi |
const double_sqrt_pi : SAME := FLTD::double_sqrt_pi.flt ; |
---|
**** | App 2*(pi.sqrt) |
const e : SAME := FLTD::e.flt ; |
---|
**** | approximately |
const epsilon : SAME := 1.19209290e-07 ; |
---|
**** | min x > 0.0 s.t, 1.0+x/=x |
const half : SAME := 0.5 ; |
---|
**** | used in rounding! |
const half_pi : SAME := FLTD::half_pi.flt ; |
---|
**** | Approx pi/2. |
const inv_pi : SAME := FLTD::inv_pi.flt ; |
---|
**** | Approx 1/pi. |
const inv_sqrt_2 : SAME := FLTD::inv_sqrt_2.flt ; |
---|
**** | Approx 1/(2.sqrt). |
const is_limited : BOOL := true ; .. Included as is_limited |
---|
const is_signed : BOOL := true ; .. Included as is_signed |
---|
const log10_e : SAME := FLTD::log10_e.flt ; |
---|
**** | Approx e.log10. |
const log2_e : SAME := FLTD::log2_e.flt ; |
---|
**** | Approx e.log2. |
const log_10 : SAME := FLTD::log_10.flt ; |
---|
**** | Approx 10.log. |
const log_2 : SAME := FLTD::log_2.flt ; |
---|
**** | Approx 2.log. |
const mantissa_bits : INT := 24 ; |
---|
**** | No of bits in the significand, including an implied bit. |
const max_exp10 : INT := 38 ; |
---|
**** | max x s.t 10^x is in range. |
const max_exp : INT := 128 ; |
---|
**** | maximum permissible exponent |
const min_exp10 : INT := -37 ; |
---|
const min_exp : INT := -125 ; |
---|
const one : SAME := 1.0 ; |
---|
const pi : SAME := FLTD::pi.flt ; |
---|
**** | approximately! |
const quarter_pi : SAME := FLTD::quarter_pi.flt ; |
---|
**** | Approx pi/4. |
const sqrt_2 : SAME := FLTD::sqrt_2.flt ; |
---|
**** | Approx 2.sqrt. |
const zero : SAME := 0.0 ; |
---|
**** | See $NFE. |
abs : SAME |
---|
acosh : FLT .. Included as acosh |
---|
aget( .. Included as aget |
---|
aset( .. Included as aset |
---|
asinh : FLT .. Included as asinh |
---|
atanh : FLT .. Included as atanh |
---|
bessel_j0 : FLT .. Included as bessel_j0 |
---|
bessel_j1 : FLT .. Included as bessel_j1 |
---|
bessel_jn( .. Included as bessel_jn |
---|
bessel_y0 : FLT .. Included as bessel_y0 |
---|
bessel_y1 : FLT .. Included as bessel_y1 |
---|
bessel_yn( .. Included as bessel_yn |
---|
binstr : BINSTR .. Included as binstr |
---|
build(cursor : BIN_CURSOR) : SAME .. Included as build |
---|
build( .. Included as build |
---|
card : CARD |
---|
ceiling : SAME |
---|
copysign(other : SAME) : SAME |
---|
cos:SAME |
---|
cosh : FLT .. Included as cosh |
---|
create(str : BINSTR) : SAME .. Included as create |
---|
create(val : CARD) : SAME |
---|
**** |
__This_routine_returns_the_value_of_val_converted_to_a_floating_point_representation. |
create(val : FIELD) : SAME |
---|
**** |
__This_routine_returns_the_value_of_val_converted_to_a_floating_point_representation. |
create(val : FLT) : SAME |
---|
**** |
__This_routine_returns_the_value_of_val_since_this_routine_is_provided ___for_symmetry_between_numeric_conversion/creation_routines. |
create(val : FLTD) : SAME |
---|
create(val : INT) : SAME |
---|
**** | This routine returns the value of val converted to a floating point representation. |
create(val : INTI) : SAME |
---|
**** | pre (val < maxval.round.inti) and (val > minval.round.inti) |
create(val : RAT) : SAME |
---|
create( .. Included as create |
---|
cube : SAME .. Included as cube |
---|
cube_root : SAME |
---|
div(other : SAME) : SAME |
---|
eng_str( .. Included as eng_str |
---|
eng_str : STR .. Included as eng_str |
---|
erf : FLT .. Included as erf |
---|
exp10 : FLT .. Included as exp10 |
---|
exp2 : FLT .. Included as exp2 |
---|
exp : SAME |
---|
**** |
__This_routine_returns_the_exponential_e^self.___Built-in. |
exp_minus_one : FLT .. Included as exp_minus_one |
---|
field : FIELD |
---|
floor : SAME |
---|
flt : FLT |
---|
fltd : FLTD |
---|
fmt( .. Included as fmt |
---|
fmt( .. Included as fmt |
---|
gamma : FLT .. Included as gamma |
---|
get_representation(out sign : BOOL, out exp : INT, out mantissa : INT) |
---|
hash : CARD .. Included as hash |
---|
**** |
hypot( .. Included as hypot |
---|
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. |
in_range(rng : $RANGE{ATP}) : 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. |
infinity : SAME |
---|
**** |
__This_routine_returns_the_representation_of_infinity_--_which_is ___implementation-dependent.___Built-in_to_this_implementation. |
int : INT |
---|
inti : INTI |
---|
is_eq(other : SAME) : BOOL |
---|
**** | This predicate returns tru if and only if self and other have the same value. Built-in to this implementation. |
is_eq(other : $OB) : BOOL .. Included as is_eq |
---|
**** | This is the generic equality predicate. c.f. the class $IS_EQ |
is_exact : BOOL .. Included as is_exact |
---|
**** | This predicate returns true if and only if self is an exact integral value. |
is_finite : BOOL |
---|
**** |
__This_predicate_returns_true_if_and_only_if_self_is_zero,_subnormal ___or_normal. |
is_inf : BOOL |
---|
**** |
__This_predicate_returns_true_if_and_only_if_self_is_infinite. |
is_lt(other : SAME ) : BOOL |
---|
**** |
__This_predicate_returns_true_if_and_only_if_other_is_less_than_self. ___Built-in_to_this_implementation. |
is_nan : BOOL .. Included as is_nan |
---|
**** |
__This_predicate_returns_true_if_and_only_if_self_is_the_NaN_value. ___This_implementatioin_makes_use_of_the_fact_that_in_the_IEEE_arithmetic ___model_the_only_value_which_will_not_compare_with_anything_is_the ___signalling_NaN. |
is_neg : BOOL .. Included as is_neg |
---|
**** |
__This_predicate_returns_true_if_and_only_if_the_value_of_self_is_less_than_zero. |
is_nil : BOOL .. Included as is_nil |
---|
**** |
__This_predicate_returns_true_if_and_only_if_self_is_the_nil_value. ___This_implementatioin_makes_use_of_the_fact_that_in_the_IEEE_arithmetic ___model_the_only_value_which_will_not_compare_with_anything_is_the ___signalling_NaN. |
is_non_neg : BOOL is return is_neg.not; end; .. Included as is_non_neg |
---|
is_non_pos : BOOL is return is_pos.not; end; .. Included as is_non_pos |
---|
is_non_zero : BOOL is return is_zero.not; end; .. Included as is_non_zero |
---|
is_normal : BOOL |
---|
**** |
__This_predicate_returns_true_if_and_only_if_self_is_a_normalised ___number.___Built-in_to_this_implementation. |
is_pos : BOOL .. Included as is_pos |
---|
**** |
__This_predicate_returns_true_if_and_only_if_the_value_of_self_is ___greater_than_zero. |
is_real( .. Included as is_real |
---|
is_subnormal : BOOL |
---|
**** |
__This_predicate_returns_true_if_and_only_if_self_is_an_un-normalised ___number.___Built-in_to_this_implementation. |
is_zero : BOOL |
---|
**** |
__This_predicate_returns_true_if_and_only_if_self_is_zero.___Built-in_to ___this_implementation. |
log10 : FLT .. Included as log10 |
---|
log2 : FLT .. Included as log2 |
---|
log : SAME |
---|
**** |
__This_routine_returns_the_natural_logarithm_of_self.__Built-in. |
log_gamma : FLT .. Included as log_gamma |
---|
max(other : SAME) : SAME .. Included as max |
---|
max_normal : SAME |
---|
**** |
__This_routine_returns_the_largest_normalized_positive_number ___in_this_class.___Built-in_to_this_implementation. |
max_subnormal : SAME |
---|
**** |
__This_routine_returns_the_largest_un-normalized_positive_number ___in_this_class.___Built-in_to_this_implementation. |
maxval : SAME .. Included as maxval |
---|
**** |
__This_routine_returns_the_maximum_representable_value_of_an_object_in_this_class. |
min(other : SAME) : SAME .. Included as min |
---|
min_normal : SAME |
---|
**** |
__This_routine_returns_the_smallest_normalized_positive_number ___in_this_class.___Built-in_to_this_implementation. |
min_subnormal : SAME |
---|
**** | This routine returns the smallest un-normalized positive number
___in_this_class.___Built-in_to_this_implementation. |
minus(other : SAME) : SAME |
---|
minval : SAME .. Included as minval |
---|
**** |
__This_routine_returns_the_maximum_representable_value_of_an_object_in_this_class. |
mod( other : SAME) : SAME |
---|
negatable : BOOL .. Included as negatable |
---|
**** |
__This_predicate_returns_true_if_and_only_if_this_class_is_numeric_and ___negatable_--_trivially_true! |
negate : SAME |
---|
nextdown : SAME |
---|
nextup : SAME |
---|
nil : SAME .. Included as nil |
---|
**** |
__This_routine_returns_the_value_used_to_represent_NIL_--_in_this ___case_the_signalling_NaN_value! |
num_chars : CARD .. Included as num_chars |
---|
one_minus_erf : FLT .. Included as one_minus_erf |
---|
plus(other : SAME) : SAME |
---|
plus_one_log : FLT .. Included as plus_one_log |
---|
pow(arg : SAME) : SAME |
---|
**** |
__This_routine_returns_self_raised_to_the_arg'th_power. ___Note_that_self.pow(0.0)_=_1.0_for_all_self.___Built-in. |
quiet_NaN(sig : INT) : SAME |
---|
**** |
__This_routine_returns_the_representation_which_is_interpreted_by ___the_IEEE_arithmetic_model_as_being_a_quiet_(ie_non-interrupting)_NaN. ___The_argument_is_not_used_in_this_implementation.___Built-in_to_this_implementation. |
rat : RAT |
---|
raw_str( .. Included as raw_str |
---|
raw_str : STR .. Included as raw_str |
---|
read(index : BIN_CURSOR) : SAME .. Included as read |
---|
remainder(other : SAME) : SAME |
---|
round : SAME |
---|
scale_by(exp : INT) : SAME |
---|
sgn : SAME .. Included as sgn |
---|
sign : NUM_SIGNS .. Included as sign |
---|
signalling_NaN(sig : INT) : SAME |
---|
**** |
__This_routine_returns_the_representation_which_is_interpreted_by ___the_IEEE_arithmetic_model_as_a_signalling_(ie_interrupt_generating)_NaN. ___The_argument_is_unused_in_this_implementation.___Built-in_to_this_implementation. |
signbit_set : BOOL |
---|
**** | This predicate returns true if and only if the sign bit of self is
___set.___Built-in_to_this_implementation. |
sin:SAME |
---|
sinh : FLT .. Included as sinh |
---|
sqrt : SAME |
---|
square : SAME .. Included as square |
---|
str( .. Included as str |
---|
str( .. Included as str |
---|
str( .. Included as str |
---|
str : STR .. Included as str |
---|
tan:SAME |
---|
tanh : FLT .. Included as tanh |
---|
times(other : SAME) : SAME |
---|
truncate : SAME |
---|
unbiassed_exponent : INT |
---|
write(fyle : BIN_FILE) .. Included as write |
---|
aelt!( .. Included as aelt! |
---|
aelt!( .. Included as aelt! |
---|
aelt!( .. Included as aelt! |
---|
aelt! : T .. Included as aelt! |
---|
aind! : CARD .. Included as aind! |
---|
product!(val : SAME) : SAME .. Included as product! |
---|
sum!(val : SAME) : SAME .. Included as sum! |
---|
const Decimal_Base : CARD := 10 ; .. Included as Decimal_Base |
---|
const Eng_Places : CARD := 3 ; .. Included as Eng_Places |
---|
Infinity, Not_a_Number ; .. Included as Infinity |
---|
const Msg_Cnt : CARD := Not_a_Number + 1 ; .. Included as Msg_Cnt |
---|
shared Names : ARRAY{STR} ; .. Included as Names |
---|
**** | for external representation! |
shared Names : ARRAY{STR} ; .. Included as Names |
---|
**** | for external representation! |
Infinity, Not_a_Number ; .. Included as Not_a_Number |
---|
const asize : CARD := 4 ; |
---|
**** | ---------------???????? FUDGE!! |
assemble( .. Included as assemble |
---|
check_names( .. Included as check_names |
---|
cuberoot : SAME |
---|
**** |
__This_routine_returns_the_cube_root_of_self.____It_is_provided ___to_avoid_the_circularity_in_cube_and_cube-root_pre-requisites!__Built-in ___to_this_implementation. |
do_specials( .. Included as do_specials |
---|
do_value( .. Included as do_value |
---|
eval_exponent : INT .. Included as eval_exponent |
---|
exp_scan( .. Included as exp_scan |
---|
fraction_part( .. Included as fraction_part |
---|
integral_part( .. Included as integral_part |
---|
is_legal_aelts_arg( .. Included as is_legal_aelts_arg |
---|
shared lib : LIBCHARS ; .. Included as lib |
---|
shared lib : LIBCHARS ; .. Included as lib |
---|
make_val( .. Included as make_val |
---|
mantissa : FLIST{CARD} .. Included as mantissa |
---|
next_down : SAME |
---|
**** | This routine returns the next lower representable number from self.
___Note_that_this_version_has_NO_pre_requisites_in_order_to_prevent ___circularity_between_the_public_versions_of_nextup_and_nextdown.__Built-in ___to_this_implementation. |
next_up : SAME |
---|
**** | This private routine returns the next higher representable number
___from_self.___Note_that_this_version_has_NO_pre_requisites_in_order_to ___prevent_circularity_between_the_public_versions_of_nextup_and_nextdown. ___Built-in_to_this_implementation. |
resize( .. Included as resize |
---|
roundup( .. Included as roundup |
---|
scale_by_builtin(exp : INT) : SAME |
---|
scan( .. Included as scan |
---|
sig_figs( .. Included as sig_figs |
---|
square_root : SAME |
---|
**** |
__This_private_routine_returns_the_square_root_of_self.__It_is_provided ___to_avoid_the_circularity_in_square_and_square-root_pre-requisites! ___Built-in_to_this_implementation. |