Class: Flt::BinNum::Context

Inherits:
Num::ContextBase show all
Defined in:
lib/flt/bin_num.rb

Overview

This is the Context class for Flt::BinNum.

The context defines the arithmetic context: rounding mode, precision,…

BinNum.context is the current (thread-local) context for DecNum numbers.

Constant Summary

Constants inherited from Num::ContextBase

Num::ContextBase::CONDITION_MAP

Instance Attribute Summary

Attributes inherited from Num::ContextBase

#angle, #capitals, #clamp, #emax, #emin, #flags, #ignored_flags, #rounding, #traps

Instance Method Summary collapse

Methods inherited from Num::ContextBase

#Num, #[], #_coerce, #abs, #add, #assign, #clamp?, #cmath, #coefficient, #coercible_types, #coercible_types_or_num, #compare, #convert_to, #copy_abs, #copy_from, #copy_negate, #copy_sign, #define_conversion_from, #define_conversion_to, #digits, #digits=, #div, #divide, #divide_int, #divmod, #divrem, #dup, #elimit=, #etiny, #etop, #eval, #exact, #exact=, #exact?, #exception, #exp, #exponent, #fma, #ignore_all_flags, #ignore_flags, #infinite?, #infinity, #inspect, #int_div_radix_power, #int_mult_radix_power, #int_radix_power, #ln, #log, #log10, #log2, #logb, #math, #maximum_coefficient, #maximum_finite, #maximum_nan_diagnostic_digits, #maximum_subnormal, #minimum_nonzero, #minimum_normal, #minimum_normalized_coefficient, #minus, #modulo, #multiply, #nan, #nan?, #necessary_digits, #next_minus, #next_plus, #next_toward, #normal?, #normalize, #normalized_integral_exponent, #normalized_integral_significand, #num_class, #number_class, #one_half, #plus, #power, #prec, #prec=, #precision, #precision=, #quantize, #radix, #rationalize, #reduce, #regard_flags, #remainder, #remainder_near, #representable_digits, #rescale, #same_quantum?, #scaleb, #sign, #special?, #split, #sqrt, #subnormal?, #subtract, #to_eng_string, #to_int_scale, #to_integral_exact, #to_integral_value, #to_normalized_int_scale, #to_r, #to_s, #to_sci_string, #to_string, #ulp, #zero, #zero?

Constructor Details

#initialize(*options) ⇒ Context

See Flt::Num::ContextBase#new() for the valid options

See also the context constructor method Flt::Num.Context().



46
47
48
# File 'lib/flt/bin_num.rb', line 46

def initialize(*options)
  super(BinNum, *options)
end

Instance Method Details

#epsilon(sign = +1) ⇒ Object

Normalized epsilon; see Num::Context.epsilon()



54
55
56
# File 'lib/flt/bin_num.rb', line 54

def epsilon(sign=+1)
  super.normalize
end

#half_epsilon(sign = +1) ⇒ Object

Normalized strict epsilon; see Num::Context.epsilon()



64
65
66
# File 'lib/flt/bin_num.rb', line 64

def half_epsilon(sign=+1)
  super.normalize
end

#strict_epsilon(sign = +1) ⇒ Object

Normalized strict epsilon; see Num::Context.epsilon()



59
60
61
# File 'lib/flt/bin_num.rb', line 59

def strict_epsilon(sign=+1)
  super.normalize
end