Method: Flt::FormatBase#to_bits_text
- Defined in:
- lib/float-formats/classes.rb
#to_bits_text(base) ⇒ Object
Returns the encoded integral value of a floating point number as a text representation in a given base. Accepts either a Value or a byte String.
174 175 176 177 178 179 180 181 182 183 184 |
# File 'lib/float-formats/classes.rb', line 174 def to_bits_text(base) to_bits.to_s(base) #i = to_bits #fmt = Numerals::Format[base: base] #if [2,4,8,16].include?(base) # n = (Math.log(base)/Math.log(2)).round.to_i # digits = (form_class.total_bits+n-1)/n # fmt.set_trailing_zeros!(digits) #end #fmt.writ(i.to_i) end |