From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: `string-to-number' 0 Date: Wed, 26 Feb 2020 09:44:34 +0100 Message-ID: <87a755g2kt.fsf@ebih.ebihd> References: <87a756gedt.fsf@ebih.ebihd> <875zfugdip.fsf@ebih.ebihd> <871rqigcs7.fsf_-_@ebih.ebihd> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="72205"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: VanL Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 26 10:19:33 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j6sqq-000Ifc-WB for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 26 Feb 2020 10:19:33 +0100 Original-Received: from localhost ([::1]:40776 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6sqq-0002w8-0m for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 26 Feb 2020 04:19:32 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42681) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6sJ8-0006t7-M3 for help-gnu-emacs@gnu.org; Wed, 26 Feb 2020 03:44:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6sJ7-00027C-Hv for help-gnu-emacs@gnu.org; Wed, 26 Feb 2020 03:44:42 -0500 Original-Received: from sender11-pp-f111.zoho.eu ([31.186.226.252]:25133) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j6sJ7-00020z-80 for help-gnu-emacs@gnu.org; Wed, 26 Feb 2020 03:44:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1582706675; s=admin; d=zoho.eu; i=moasenwood@zoho.eu; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID:MIME-Version:Content-Type; bh=ArqppfA5zY6kKIyjAoBP1YDDYKZcJoT5W38yps4/Gxg=; b=Rn+KgHIDfJpV/B8/D0veCoEakHbs/mIILKzm+9uFV/1EHBVaa3RLudggdzrZZqBs sToa9IxHczlBfVy5er4RSU2QTOyOzUH34nvUtPzC/yWDm7fHurHL2hOWu1ULjX+vjig Z83KlVB39+9cHUeVeaHtH0i2Mx6NEcdxA4ZloR10= Original-Received: from ebih.zoho.eu (c-b895225c.021-67-7570702.bbcust.telenor.se [92.34.149.184]) by mx.zoho.eu with SMTPS id 158270667525736.55970056771423; Wed, 26 Feb 2020 09:44:35 +0100 (CET) Mail-Copies-To: never In-Reply-To: (VanL's message of "Wed, 26 Feb 2020 18:37:50 +1100") X-ZohoMailClient: External X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 31.186.226.252 X-Mailman-Approved-At: Wed, 26 Feb 2020 04:17:36 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:122477 Archived-At: VanL wrote: >> (string-to-number "a") ; 0 >> (string-to-number "0") ; 0 >> (string-to-number "1") ; 1 >> >> From the docstring: "Return 0 if STRING >> cannot be parsed as an integer or floating >> point number." > > (string-to-number "") ; 60 I get two big 0s: (string-to-number "a") ; 0 (string-to-number "") ; 0 The docstring also says "Parse STRING as a decimal number and return the number." ... but isn't 0 a decimal number? But come to think of it, it actually DOES work for 0! (string-to-number "0") ; 0 Its just one can't tell that from the bogus inputs and their outputs, which are 0 as well. One can just verify the input, I guess. Meta: I got this message as a mail, and it seems it didn't show up in . So I suppose I reply to it as a mail as well, and that defaults to To: header to the previous poster, and Cc: header to . Keep it uptime. Atem. -- underground experts united http://user.it.uu.se/~embe8573 https://dataswamp.org/~incal