Class: Flt::DecimalFormatBase

Inherits:
FormatBase show all
Defined in:
lib/float-formats/classes.rb

Overview

Base class for decimal floating point formats

Direct Known Subclasses

BCDFormat, DPDFormat

Constant Summary

Constants included from Flt

APPLE, IEEE_128, IEEE_128_BE, IEEE_DEC128, IEEE_DEC32, IEEE_DEC64, IEEE_DOUBLE, IEEE_D_BE, IEEE_EXTENDED, IEEE_HALF, IEEE_H_BE, IEEE_QUAD, IEEE_Q_BE, IEEE_SINGLE, IEEE_S_BE, IEEE_X_BE, IEEE_binaryx, RPL, RPL_X

Instance Attribute Summary

Attributes inherited from FormatBase

#exponent, #sign, #significand

Class Method Summary collapse

Methods inherited from FormatBase

#<=>, arithmetic, arithmetic_type, bias, canonicalized, context, #convert_to, endianness, epsilon, #form_class, #fp_format, from, from_bits, from_bits_text, from_bytes, from_hex, from_number, from_text, gradual_underflow?, half_epsilon, #infinite?, infinity, #initialize, join, max_value, maximum_integral_significand, min_normalized_value, min_value, minimum_normalized_integral_significand, #minus, minus_sign_value, nan, #nan?, #next_minus, #next_plus, nio_read_neutral, #nio_write_neutral, #normal?, num, num_class, pack_fields_hash, radix_max_exp, radix_min_exp, rounding_mode, sign_from_unit, sign_to_unit, #split, strict_epsilon, #subnormal?, switch_sign_value, #to, #to_a, #to_bits, #to_bits_text, #to_bytes, #to_hex, #to_num, #to_text, #ulp, unpack_fields_hash, zero, #zero?

Methods included from Flt

#*, #+, #-, #-@, #/, bcd2dpd, bitnot, convert_bytes, dbl_from_float, dbl_from_text, dbl_to_float, dpd2bcd, dpd_to_hexbcd, float_bin, float_dec, float_from_integral_sign_significand_exponent, float_from_integral_significand_exponent, float_shortest_dec, float_significant_dec, float_to_integral_sign_significand_exponent, float_to_integral_significand_exponent, hex_from_float, hex_to_float, hexbcd_to_dpd, sgl_from_float, sgl_from_text, sgl_to_float

Constructor Details

This class inherits a constructor from Flt::FormatBase

Class Method Details

.decimal_digits_necessaryObject



1092
1093
1094
# File 'lib/float-formats/classes.rb', line 1092

def self.decimal_digits_necessary
  significand_digits
end

.decimal_digits_storedObject



1089
1090
1091
# File 'lib/float-formats/classes.rb', line 1089

def self.decimal_digits_stored
  significand_digits
end

.decimal_max_expObject



1095
1096
1097
# File 'lib/float-formats/classes.rb', line 1095

def self.decimal_max_exp
  radix_max_exp(:scientific_significand)
end

.decimal_min_expObject



1098
1099
1100
# File 'lib/float-formats/classes.rb', line 1098

def self.decimal_min_exp
  radix_min_exp(:scientific_significand)
end

.define(params) ⇒ Object

:stopdoc:



1071
1072
1073
1074
# File 'lib/float-formats/classes.rb', line 1071

def self.define(params)
  @hidden_bit = false
  super params
end

.radixObject



1075
1076
1077
# File 'lib/float-formats/classes.rb', line 1075

def self.radix
  10
end

.radix_log(x) ⇒ Object



1085
1086
1087
# File 'lib/float-formats/classes.rb', line 1085

def self.radix_log(x)
  Math.log(x)/Math.log(10)
end

.radix_log10Object



1082
1083
1084
# File 'lib/float-formats/classes.rb', line 1082

def self.radix_log10
  1
end

.radix_power(n) ⇒ Object



1078
1079
1080
# File 'lib/float-formats/classes.rb', line 1078

def self.radix_power(n)
  10**n
end