all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Vincent Belaïche" <vincent.b.1@hotmail.fr>
Cc: cyd@stupidchicken.com, emacs-devel <emacs-devel@gnu.org>
Subject: Re: Code for converting between Elisp and Calc floats
Date: Tue, 27 Oct 2009 02:16:07 -0400	[thread overview]
Message-ID: <jwvocnte5aa.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <BLU104-W109BFD7C264619CEFBFC9184B90@phx.gbl> ("Vincent Belaïche"'s message of "Tue, 27 Oct 2009 05:56:50 +0100")

> For the C code anyhow, even if the integer component word size was not
> passed along in the interface, you would have anyhow to manage strange
> word sizes. This is because the mantissa is 53 bits, and 53 is not
> a multiple of 16. Also the mantissa is not aligned on the double word
> boundary (the sign + exponent not being a muliple of 16 bits) and you
> also have this phantom bit case to handle.

I think if you use frexp+floor, most of those issues won't matter much.

>> I think it fits better in C. Basically, it would be the equivalent to
>> C's frexp.
> C++' frexp and ldexp are not a direct alternative,

I understand.  The interface you proposed is closer to what we'd like
than what frexp has to offer.

> Another alternative would be that frexp and ldexp and suhlikes are
> made builtin functions, and that the construct-float,
> deconstruct-float functions are in Lisp using those builtins: that
> would indeed be my preference if everyone thinks that the submitted
> C code is too complex. 

Actually my preference would be to keep the functionality you proposed
(i.e. two functions (de)construct-float written in C), except force the
base to be 65536 (i.e. 16bits per integer), and rewrite the C code to
use standard functions like frexp, floor, isnan, and friends.


        Stefan




  reply	other threads:[~2009-10-27  6:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-27  4:56 Code for converting between Elisp and Calc floats Vincent Belaïche
2009-10-27  6:16 ` Stefan Monnier [this message]
2009-10-27 19:38   ` Vincent Belaïche
  -- strict thread matches above, loose matches on Subject: below --
2009-10-08 20:47 allow C-x v i / C-x v v to create a repository if none is available Dan Nicolaescu
2009-10-09 19:18 ` Stefan Monnier
2009-10-22 18:56   ` Code for converting between Elisp and Calc floats Jay Belanger
2009-10-22 20:04     ` James Cloos
2009-10-23  0:50     ` Stefan Monnier
2009-10-24 20:03       ` Jay Belanger
2009-10-25  0:56         ` Stefan Monnier
2009-10-25  5:36           ` David Kastrup
2009-10-25 11:36             ` Vincent Belaïche
2009-10-25 14:11               ` Chong Yidong
2009-10-25 19:29                 ` Vincent Belaïche
2009-10-26  2:30                   ` Stefan Monnier
2009-10-26 12:48                     ` Vincent Belaïche
2009-10-27  3:22                       ` Stefan Monnier
2009-10-25 13:57             ` Stefan Monnier
2009-10-25 18:35               ` Eli Zaretskii
2009-10-23 13:11     ` Richard Stallman
2009-10-23 13:26       ` David Kastrup
2009-10-24 17:34         ` Richard Stallman

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=jwvocnte5aa.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=vincent.b.1@hotmail.fr \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.