[Cbor] Re: EDN -0
Joe Hildebrand <hildjj@cursive.net> Tue, 27 August 2024 02:35 UTC
Return-Path: <hildjj@cursive.net>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C018FC151985 for <cbor@ietfa.amsl.com>; Mon, 26 Aug 2024 19:35:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.106
X-Spam-Level:
X-Spam-Status: No, score=-2.106 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cursive.net
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0oKQdR6FUnye for <cbor@ietfa.amsl.com>; Mon, 26 Aug 2024 19:35:50 -0700 (PDT)
Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id CF341C14F602 for <cbor@ietf.org>; Mon, 26 Aug 2024 19:35:50 -0700 (PDT)
Received: by mail-io1-xd32.google.com with SMTP id ca18e2360f4ac-81f8f0198beso244730839f.1 for <cbor@ietf.org>; Mon, 26 Aug 2024 19:35:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cursive.net; s=google; t=1724726150; x=1725330950; darn=ietf.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=StVMZmDddd0QNhd0sqgh2LLRyTXoSnNz/G37arRezWM=; b=oaKrAZ1/g9/TrQjNOpRxO5pvA2tZilVQMK8jroAPUx6RvxDDKU/75AJM9RY2kK2Xx4 t9X6nzMj4VjjmPkXFcJ58cG/RQJn7aJleNKydqC8kazRppWZ82h8hLvGslkxPwBKiPlV kCBvYXOrbJl1FPDsZTTrUbR8GIRAQ04csYyRc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724726150; x=1725330950; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=StVMZmDddd0QNhd0sqgh2LLRyTXoSnNz/G37arRezWM=; b=SVqxuPFjM/gpvAIpc5XWKWQLyIpzDUSh77DdIUnjns8UQuXN8M6uNqpYOMz5a1W+P6 2Xs+nsZmOnyDIXGe37rSWFC0D7UtPLLjqdm6LDbvj/FYLAybhL6mB7424fUOp9oKG/IF HeU9PD5VfjiwOYN7o0V3rF4vtKEY/nw0BOEUA00awTm0ai1mxiQC/Xpu+uWdYIPJOJRi L179Opprj0ecb0H9JHcwpljcsRtJ+2PrUesltFDGmtLsrmNLdabqrqYo3PCsQB5qmfaa mPW9lNGG1gV3/g/CzypSt8r3qLawlZ5TelR/I3PpbtN+aJ4uZ5Epf7RLHTwEHGTAQzOi uuyg==
X-Gm-Message-State: AOJu0YwrIjzF+YAFLV+U7QrOH7JodwPNH04LO9D5dfTihS8ApQxmmCmw upmKmMwtrnZzGAsYjMtjd4zIjFXXH5nycF17jvwIOVJhqEOssTJ2XYhryX4XIQ==
X-Google-Smtp-Source: AGHT+IGyz4H+yiCndNg86E5Rk2GwnefLGnukUkmMozwHtRgo/QqLKYwkTxXfNCMwMkL8tmiI7ctPVA==
X-Received: by 2002:a92:ca4c:0:b0:39b:2133:8ed4 with SMTP id e9e14a558f8ab-39e3c98c893mr144548075ab.14.1724726149595; Mon, 26 Aug 2024 19:35:49 -0700 (PDT)
Received: from smtpclient.apple ([2601:282:2181:450f:b044:e472:51c1:a3a]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-39d73eedd30sm36499775ab.74.2024.08.26.19.35.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Aug 2024 19:35:49 -0700 (PDT)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\))
From: Joe Hildebrand <hildjj@cursive.net>
In-Reply-To: <CAKoiRuaZX5ra2Etho59PP2JJFGYfUC2ninG-LRHu+Cp9erBzpw@mail.gmail.com>
Date: Mon, 26 Aug 2024 20:35:38 -0600
Content-Transfer-Encoding: quoted-printable
Message-Id: <502C7FA2-92B7-4205-A659-74A20FEFBE8A@cursive.net>
References: <9620A48C-10A3-4708-89D4-4E121043E786@cursive.net> <CAKoiRubf5YdxhsEBqZn0aHBmsGjZahg-u3KX_TM8mLLOf3Ks4Q@mail.gmail.com> <441B63D7-CEDB-40F9-BE48-60155BB58725@cursive.net> <CAKoiRuaZX5ra2Etho59PP2JJFGYfUC2ninG-LRHu+Cp9erBzpw@mail.gmail.com>
To: Rohan Mahy <rohan.mahy@gmail.com>
X-Mailer: Apple Mail (2.3776.700.51)
Message-ID-Hash: KVTZVKSLXS7IYXR352LLXXVNLZRRPMHN
X-Message-ID-Hash: KVTZVKSLXS7IYXR352LLXXVNLZRRPMHN
X-MailFrom: hildjj@cursive.net
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-cbor.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: CBOR <cbor@ietf.org>
X-Mailman-Version: 3.3.9rc4
Precedence: list
Subject: [Cbor] Re: EDN -0
List-Id: "Concise Binary Object Representation (CBOR)" <cbor.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/JANbkrC3GFlhviO2TPUndS0TJPM>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Owner: <mailto:cbor-owner@ietf.org>
List-Post: <mailto:cbor@ietf.org>
List-Subscribe: <mailto:cbor-join@ietf.org>
List-Unsubscribe: <mailto:cbor-leave@ietf.org>
Eh, I don't care that much, -0 => 0 is fine with me. I think this way is more likely to be surprising than -0 -> -0.0, but the simple rule is alluring. Can we document it? — Joe Hildebrand > On Aug 26, 2024, at 8:13 PM, Rohan Mahy <rohan.mahy@gmail.com> wrote: > > > Why would I have typed -0 if I wanted 0? > Let's be clear. The user typed something dumb. If they wanted floating point -0.0 they should have written that. If they wanted 0, they should have typed that. We are debating if it is better to make an exception to the simple rule about having a decimal point or other indicator of floating point present to make something floating point or not. Every other integer is represented as a CBOR integer. > > > It *doesn't* have a value in the integer space, like NaN or Infinity. > In the integer space -0 *equals* 0. -0 does not have a *unique* value in the integer space, but it *does* have a value. > > Thanks, > -rohan > > On Mon, Aug 26, 2024 at 6:17 PM Joe Hildebrand <hildjj@cursive.net> wrote: > Why would I have typed -0 if I wanted 0? > > It *doesn't* have a value in the integer space, like NaN or Infinity. > > — > Joe Hildebrand > > > On Aug 26, 2024, at 5:35 PM, Rohan Mahy <rohan.mahy@gmail.com> wrote: > > > > Why not represent EDN -0 be the unsigned int zero since it has the value in the integer space and has no decimal point? > > Thanks, > > -r > > > > > > On Mon, Aug 26, 2024 at 3:56 PM Joe Hildebrand <hildjj@cursive.net> wrote: > > Perhaps EDN -0 is supposed to be denote the integer 0 because of this language: > > > > > > ``` > > decnumber stands for an integer in the usual decimal notation, unless at least one of the optional parts starting with "." and "e" are present, in which case it stands for a floating point value in the usual decimal notation. Note that the grammar now allows 3. for 3.0 and .3 for 0.3 (also for hexadecimal floating point below); implementers are advised that some platform numeric parsers accept only a subset of the floating point syntax in this document and may require some preprocessing to use here. > > ``` > > > > I implemented -0 to always return a float, since it's the only number without a decimal or exponent that can't be encoded as an integer. I think that's more correct, but I am willing to be wrong. > > > > Either way, can we have an explicit call out for -0 in this paragraph? > > > > — > > Joe Hildebrand > > > > _______________________________________________ > > CBOR mailing list -- cbor@ietf.org > > To unsubscribe send an email to cbor-leave@ietf.org >
- [Cbor] EDN -0 Joe Hildebrand
- [Cbor] Re: EDN -0 Rohan Mahy
- [Cbor] Re: EDN -0 Joe Hildebrand
- [Cbor] Re: EDN -0 Rohan Mahy
- [Cbor] Re: EDN -0 Joe Hildebrand
- [Cbor] Re: EDN -0 Carsten Bormann
- [Cbor] Re: EDN -0 Joe Hildebrand