Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

A person with one watch knows what time it is; a person with two watches is never sure. Proverb


devel / comp.lang.python / divmod with negative Decimal values

SubjectAuthor
o divmod with negative Decimal valuesRob Cliffe

1
divmod with negative Decimal values

<mailman.244.1692685509.23016.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=28328&group=comp.lang.python#28328

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: rob.cliffe@btinternet.com (Rob Cliffe)
Newsgroups: comp.lang.python
Subject: divmod with negative Decimal values
Date: Fri, 18 Aug 2023 10:14:18 +0100
Lines: 11
Message-ID: <mailman.244.1692685509.23016.python-list@python.org>
References: <ef9bb1d6-8ee2-6d96-fc9b-20075536edb5@btinternet.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de syKhkhpocHljIwmNBUQjXQQB4CvggQfRO4CLbu7z2ViA==
Cancel-Lock: sha1:LFy97ArRMS7R5dRgQYGI8FLpUIQ= sha256:OnWhPLhTLIGaAtTvsNve7J1jil2jeWd4lfuBM1b3M0c=
Return-Path: <rob.cliffe@btinternet.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=btinternet.com header.i=@btinternet.com header.b=YQE1VvtF;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.158
X-Spam-Level: *
X-Spam-Evidence: '*H*': 0.71; '*S*': 0.02; 'decimal': 0.16;
'subject:values': 0.16; 'python': 0.16; 'values': 0.17; 'to:addr
:python-list': 0.20; 'anyone': 0.25; 'follows:': 0.26; '>>>':
0.28; 'header:User-Agent:1': 0.30; 'negative': 0.32;
'to:name:python': 0.32; 'received:192.168.1': 0.32; 'using': 0.37;
'received:192.168': 0.37; 'explain': 0.40; 'received:213': 0.40;
'wishes': 0.40; 'best': 0.61; '8bit%:97': 0.84; 'rob': 0.84;
'differently': 0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=btinternet.com;
s=btmx201904; t=1692350077;
bh=wYf1wUsHY4/lAv758iW5CXqQM4Ztly25/0IZz7A9RwQ=;
h=Message-ID:Date:MIME-Version:To:From:Subject;
b=YQE1VvtFEp0pWskouSV+w8Oxi5W9+r7zq4Z6BsbKPGWa24UgbJjz0zsCUMvleCMW4lZvT93sDU1Ddznme31NJXxZ0phwjCRBe0NOR2M3ScddBzIG/4PTS31J9YwyHUbqfyYITdgovvfFfJqq89M7tzJ/J9Uqvlkcvg6V6z6tSz+lk3ssn6nP/lQPnbXHE7RPsh4VP3slSUgYL7RDt5EjraFnNGS+gdq/o5LgwRZNajgdHRZDmFQkAaAVt/QgacMun70gctwIVnjtnFCegiDaspBhvFnQ7GhNZuCW6MfaSd/kXBLluCXVfuvs8i/VDGt17syo3l6jBWpogwUEj7qwsQ==
Authentication-Results: btinternet.com;
auth=pass (PLAIN) smtp.auth=rob.cliffe@btinternet.com;
bimi=skipped
X-SNCR-Rigid: 64CAD81101D61C1F
X-Originating-IP: [86.169.136.242]
X-OWM-Source-IP: 86.169.136.242 (GB)
X-OWM-Env-Sender: rob.cliffe@btinternet.com
X-VadeSecure-score: verdict=clean score=0/300, class=clean
X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedviedruddufedgudegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuueftkffvkffujffvgffngfevqffopdfqfgfvnecuuegrihhlohhuthemuceftddunecunecujfgurhepkfffgggfvffhufgtgfesthekredttdefjeenucfhrhhomheptfhosgcuvehlihhffhgvuceorhhosgdrtghlihhffhgvsegsthhinhhtvghrnhgvthdrtghomheqnecuggftrfgrthhtvghrnhepheduvedtgfefgedvleeuieegueeutdfgheevfeduieeitdffueffgedvjeeivefgnecukfhppeekiedrudeiledrudefiedrvdegvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhephhgvlhhopegludelvddrudeikedruddrvddtgegnpdhinhgvthepkeeirdduieelrddufeeirddvgedvpdhmrghilhhfrhhomheprhhosgdrtghlihhffhgvsegsthhinhhtvghrnhgvthdrtghomhdpnhgspghrtghpthhtohepuddprhgtphhtthhopehphihthhhonhdqlhhishhtsehphihthhhonhdrohhrghdprhgvvhfkrfephhhoshhtkeeiqdduieelqddufeeiqddvgedvrdhrrghnghgvkeeiqdduieelrdgsthgtvghnthhrrghlphhluhhsrdgtohhmpdgruhhthhgpuhhsvghrpehrohgsrdgtlhhifhhfvgessghtihhnthgvrhhnvghtrdgtohhmpdhgvghokffrpefiuedpoffvtefjohhsthepshgrqdhprhguqdhrghhouhhtqddttdef
X-RazorGate-Vade-Verdict: clean 0
X-RazorGate-Vade-Classification: clean
X-SNCR-hdrdom: btinternet.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Content-Language: en-GB
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <ef9bb1d6-8ee2-6d96-fc9b-20075536edb5@btinternet.com>
 by: Rob Cliffe - Fri, 18 Aug 2023 09:14 UTC

I am using Python 3.11.4.
Can anyone explain why Decimal values behave differently from ints when
negative values are used in divmod as follows:

>>> divmod(-1, 60)
(-1, 59)                                                      # as expected
>>> divmod(Decimal("-1"), 60)
(Decimal('-0'), Decimal('-1'))

Best wishes
Rob Cliffe


devel / comp.lang.python / divmod with negative Decimal values

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor