all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Inconsistency in `string-to-number'
@ 2009-04-24  0:16 Davis Herring
  2009-04-24 10:36 ` Eli Zaretskii
  0 siblings, 1 reply; 14+ messages in thread
From: Davis Herring @ 2009-04-24  0:16 UTC (permalink / raw)
  To: emacs-devel

(string-to-number "1:") => 1
(string-to-number "1.2:") => 1
(string-to-number "1.2") => 1.2

Because of the call to isfloat_string in Fstring_to_number, the lenience
shown integers is not extended to floats, with the bizarre result that the
function succeeds but ignores part of its input.

Should there be a lenient form of isfloat_string that suppresses the check
for whitespace or NUL after the float, or is this not part of
string-to-number's "documented behavior"?  (It isn't actually documented
either to allow garbage after ints or to forbid it after floats.)

Davis

-- 
This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.




^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2009-12-04 14:22 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-24  0:16 Inconsistency in `string-to-number' Davis Herring
2009-04-24 10:36 ` Eli Zaretskii
2009-04-24 11:45   ` Juanma Barranquero
2009-04-24 13:19     ` Eli Zaretskii
2009-04-24 14:13       ` Juanma Barranquero
2009-04-24 13:22     ` Stefan Monnier
2009-04-24 13:38       ` Juanma Barranquero
2009-04-24 14:06         ` Stefan Monnier
2009-04-24 14:16           ` Juanma Barranquero
2009-09-05  0:30           ` Juanma Barranquero
2009-12-01 20:15             ` Stefan Monnier
2009-12-04  3:21               ` Juanma Barranquero
2009-12-04  3:23                 ` Juanma Barranquero
2009-12-04 14:22                 ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.