Class: Flt::CDCFormat
- Inherits:
-
BinaryFormat
- Object
- FormatBase
- FieldsInBitsFormatBase
- BinaryFormat
- Flt::CDCFormat
- Defined in:
- lib/float-formats/formats.rb
Overview
CDC 6600/7600 Byte endianness is arbitrary, since these machines were word-addressable, in 60-bit words, but the two words used in double precision numbers are in big endian order TO DO: apply this: The exponent encoded value 1023 is used for NaN The exponent encoded value 0 is used for underflow The exponent encoded value 2047 is used for overflow
The exponent needs special treatment, because instead of excess encoding, which is equivalent to two’s complement followed by sign bit reversal, one’s complement followed by sign bit reversal is used, which is equivalent to use a bias diminished by one for negative exponents. Note that the exponent encoded value that equals the bias is not used (is used as a NaN indicator)
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 BinaryFormat
define, pack, radix, radix_power, total_bits, total_bytes, unpack
Methods inherited from FieldsInBitsFormatBase
fields_radix, pack_fields, unpack_fields
Methods inherited from FormatBase
#<=>, arithmetic, arithmetic_type, bias, canonicalized, context, #convert_to, decimal_digits_necessary, decimal_digits_stored, decimal_max_exp, decimal_min_exp, define, 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, #normal?, num, num_class, numerals_conversion, pack_fields_hash, radix_log, radix_log10, radix_max_exp, radix_min_exp, radix_power, 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, define, 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
.decode_exponent(ee, mode) ⇒ Object
343 344 345 346 347 |
# File 'lib/float-formats/formats.rb', line 343 def self.decode_exponent(ee,mode) e = super e += 1 if e<0 e end |
.encode_exponent(e, mode) ⇒ Object
:nodoc:
338 339 340 341 342 |
# File 'lib/float-formats/formats.rb', line 338 def self.encode_exponent(e,mode) ee = super ee -= 1 if e<0 ee end |