Re: [ddlm-group] Is the string '2.0' an Integer?
- To: "Bollinger, John C" <John.Bollinger@stjude.org>
- Subject: Re: [ddlm-group] Is the string '2.0' an Integer?
- From: James H <jamesrhester@gmail.com>
- Date: Fri, 12 Nov 2021 13:12:46 +1100
- Cc: Group finalising DDLm and associated dictionaries <ddlm-group@iucr.org>
- In-Reply-To: <CH2PR04MB69503A8DEE0BC09DD1E710E9E0939@CH2PR04MB6950.namprd04.prod.outlook.com>
- References: <CAM+dB2fcY6ZvrH8nfbeYKJZbqRcmtPhai33Y5isQ7M2VKCVUtg@mail.gmail.com><CH2PR04MB69503A8DEE0BC09DD1E710E9E0939@CH2PR04MB6950.namprd04.prod.outlook.com>
CIF 2 does not have syntactic data typing other than for the special null-value placeholder values (. and ?). In fact, CIF 1.1 doesn’t either, notwithstanding the fact that there are productions for different flavors of number in the published formal grammar.
Â
It comes down, then, to a question of DDL[12m] and possibly of specific dictionaries. It would not be an issue with a DDL2 dictionary, because those provide details of the syntactic form of each dictionary-recognized data type within the dictionary itself. For example, inasmuch as this is inspired by concerns about the core CIF _diffrn_refln.counts_* items, it is perhaps relevant to note that the mmCIF definitions of these assign type ‘int’, which unambiguously disallows any decimal point or exponent field.
Â
But what about DDLm? There are several considerations, but as a threshold matter, is its Integer intended to be interchangeable with mmCIF’s int? If so, then that settles it: decimal points and exponents cannot then be allowed in values of (DDLm) type Integer.
Â
Suppose, however, that we did not insist on that level of compatibility. Should '2.0' (or 2.0) be accepted as conforming to type Integer? I am inclined to say not. I would find that surprising from the perspective of a data consumer. Expressing a number with those extra significant zeroes suggests that a (limited) precision is being conveyed, which is incorrect when the number is in fact an infinitely precise integer. I would also find that surprising from the perspective of a programmer, for none of the languages I know that distinguish between integers and floating-point numbers permit integers to be expressed with a decimal point.
Â
But also, I think the question is probably based on a faulty premise. This originated from a concern about conveying standard uncertainties. If a number is uncertain in the first place, so that it makes sense to compute or convey a standard uncertainty for it, then I don’t think it makes sense to insist on the base number being an integer in the first place. Such a number is necessarily an estimate of some kind (else it would not be uncertain) and even if the value it estimates is constrained to be an integer, the best statistical estimate for that value does not have the same constraint.
Â
Â
Regards,
Â
John
Â
--
John C. Bollinger, Ph.D., RHCSA
Computing and X-Ray Scientist
Department of Structural Biology
St. Jude Children's Research Hospital
(901) 595-3166 [office]
Â
Â
From: ddlm-group <ddlm-group-bounces@iucr.org> On Behalf Of James H
Sent: Tuesday, November 9, 2021 7:42 PM
To: ddlm-group <ddlm-group@iucr.org>
Subject: [ddlm-group] Is the string '2.0' an Integer?Â
Caution: External Sender. Do not open unless you know the content is safe.
Â
Antanas has asked an interesting question [1]. In essence, if data name _xyz has DDLm type 'Integer', would '2.0' conform to this specification?
Â
I think yes, for the same reasons that both delimited and undelimited strings can be interpreted as numbers. There is a single unambiguous interpretation as an integer.
Â
The reason this has come up is that e.g. total counts might be restricted to an integral value, but the SU will most often be non-integer, and using the form '2' would not allow appending the SU, whereas 2.0(14) allows this.
Â
Any comments?
Â
--T +61 (02) 9717 9907
F +61 (02) 9717 3145
M +61 (04) 0249 4148
Email Disclaimer: www.stjude.org/emaildisclaimer
Consultation Disclaimer: www.stjude.org/consultationdisclaimer
--
F +61 (02) 9717 3145
M +61 (04) 0249 4148
_______________________________________________ ddlm-group mailing list ddlm-group@iucr.org http://mailman.iucr.org/cgi-bin/mailman/listinfo/ddlm-group
Reply to: [list | sender only]
- References:
- [ddlm-group] Is the string '2.0' an Integer? (James H)
- Re: [ddlm-group] Is the string '2.0' an Integer? (Bollinger, John C)
- Prev by Date: Re: [ddlm-group] Is the string '2.0' an Integer?
- Next by Date: [ddlm-group] Multi block principles
- Prev by thread: Re: [ddlm-group] Is the string '2.0' an Integer?
- Next by thread: [ddlm-group] FYI: CIF2 table keys are unique
- Index(es):