public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Panicz Maciej Godek <godek.maciek@gmail.com>
To: kawa <kawa@sourceware.org>
Subject: Comparison of numerical types
Date: Sun, 21 Jan 2024 11:11:40 +0100	[thread overview]
Message-ID: <CAMFYt2Y1A6D_fziA-tYYXGNdCk24AGx2PuDVfhyCC65vQie+Og@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 504 bytes --]

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.

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?

             reply	other threads:[~2024-01-21 10:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-21 10:11 Panicz Maciej Godek [this message]
2024-01-21 21:14 ` Per Bothner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMFYt2Y1A6D_fziA-tYYXGNdCk24AGx2PuDVfhyCC65vQie+Og@mail.gmail.com \
    --to=godek.maciek@gmail.com \
    --cc=kawa@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).