Project

General

Profile

Actions

Bug #2144

closed

Split functionality of Float#inspect and Float#to_s

Added by rogerdpack (Roger Pack) about 15 years ago. Updated over 13 years ago.

Status:
Rejected
Assignee:
-
Target version:
ruby -v:
ruby 1.9.2dev (2009-09-26 trunk 25103) [i386-mingw32]
Backport:
[ruby-core:25796]

Description

=begin
Currently the Float#to_s and Float#inspect return an "accurate" representation of the internal float, to help alert users of floating point inconsistencies.

This is better than the old way, however some have pointed out that the old functionality has been lost [the old "pretty float" style].

In order to have 1.9.2 add functionality and not also lose the old functionality, this is a proposal to make

String#to_s the pretty way
and
String#inspect
Show the accurate way.
Then in irb users are notified of inaccuracies, and it's also more backward compatible.

I'd be ok with the two going the other way, too--just as long as there's both available somewhere.

Thanks!
-r
=end

Actions

Also available in: Atom PDF

Like0
Like0