From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailtransmit04.runbox.com (mailtransmit04.runbox.com [IPv6:2a0c:5a00:149::25]) by sourceware.org (Postfix) with ESMTPS id 046633858C50 for ; Sun, 21 Jan 2024 21:14:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 046633858C50 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=bothner.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bothner.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 046633858C50 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a0c:5a00:149::25 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705871661; cv=none; b=d/g2KLj6fJqbe1VWprCl7n6XR+Zr0tvu7GCqCWDK+Sctu6BBKQEKAgBUZTSrO7Lx3ilmtHWTAVZruCE2nhk6pJu8IP4Bs/lYF9lSaJ86doqZLFtcqyc3eEIT6f58w2WPLSzlSjmYpNCw96JdsDtSZFwUC6N4tGAw5uFgQmAh59g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705871661; c=relaxed/simple; bh=HLxVt1r3JjCd1y+CHxRqwkqlXgBGIDFiiEwmPAD50NU=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=tNUAQIdCmQ7p4G0siDJpXht4t0zyQ10yi1zdawOSBwRS/+UNT6xWm/v0f18gpPpyfKGTR61hIO/1UkolaHnekqeO59nHv8H3Qwo2SKDXLY/tGkY+bUywChUJcjy/CfOJkp3T7btZGrggmWmpzxe51x/epfI6rzcEq6Y25kjsZSo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit04.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1rRf8x-00Bhej-Hp; Sun, 21 Jan 2024 22:14:15 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=bothner.com ; s=selector2; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:To:Subject:MIME-Version:Date:Message-ID; bh=c1TxYcCNDCuiQEOGZFnNeUtfM7bVYWiB/g5nuRMNvQ0=; b=Ni634xzpOVET6YF8+M07gkTAdc lJjaHcx1vz02RB7fLvl2RK6NRUR3A93LD1PBrjyJyq6KTnQLji0azEh/bCQkvKuUzqihoUUlvRVZt oNy/t4vzBFyVhqzhFYoUTwKyx+Ox9K9Om6JELV4rPRcQu0x9M5EOQDMvZHQWMfMAg3/wW38RdyJI3 i+W6UlWMp18m6DNGXGAC2gl7S6hPT4qy7+e/gX2j+dyd+zYPVgvn7kPiEXXS88Q4TeSTe0dsKINrD BtjVJGiDXDR1sfGiGvXCJW8M7776rt+FqdoR5fLEJNmX3JJonH9vOTwxN+fQvW7dSLw0/vUgnicS/ cLmUC3BA==; Received: from [10.9.9.72] (helo=submission01.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1rRf8w-0004H6-L3; Sun, 21 Jan 2024 22:14:15 +0100 Received: by submission01.runbox with esmtpsa [Authenticated ID (524175)] (TLS1.2:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) id 1rRf8s-00BpGl-TJ; Sun, 21 Jan 2024 22:14:11 +0100 Message-ID: <30b9affb-a96f-4e1f-888e-25b384ef1251@bothner.com> Date: Sun, 21 Jan 2024 13:14:01 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Comparison of numerical types Content-Language: en-US To: Panicz Maciej Godek , kawa References: From: Per Bothner In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 1/21/24 02:11, Panicz Maciej Godek via Kawa wrote: > The equality and comparison predicates on gnu.math.UByte, gnu.math.UInt and > gnu.math.ULong require that they are compared with objects of the same type. no, that is not the case - or at least I don't think it should be > > This results in situations, where numbers with identical print > representations are not equal (in the sense of both "equal?" and "=") to > each other, and where the "less than" operator behaves counter-intuitively: >> (define b0 (gnu.math.UByte:valueOf (as byte 241))) >> (= b0 241) > #f >> (< b0 242) > #f > > Is there any particular reason for such behavior? Just a bug. Fixed now. My guess is this was a copy-paste error - I copied code from the UShort implementation into the UByte implementation, incorrectly. -- --Per Bothner per@bothner.com http://per.bothner.com/