caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Soegtrop, Michael" <michael.soegtrop@intel.com>
To: Tung Vu Xuan <toilatung90@gmail.com>
Cc: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: RE: [Caml-list] Approximations when converting from string to float
Date: Wed, 26 Oct 2016 08:08:43 +0000	[thread overview]
Message-ID: <0F7D3B1B3C4B894D824F5B822E3E5A172CFA08CF@IRSMSX102.ger.corp.intel.com> (raw)
In-Reply-To: <CAFxmOcQwFS-_46nEv6btOYdK82Pj=LtP3BNTvR4zxkTkjJE0SQ@mail.gmail.com>

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

Dear Tung,

if you are converting integers to floats (no decimal fractions) and if you can use an arbitrary precision integer library to convert from arbitrary size decimal to binary and do the truncation in the binary domain, there is no need for interval arithmetic – as Xavier also pointed out. The method I outlined is intended for limited precision integer and limited precision float arithmetic, in which case you have to throw away decimal digits and handle imprecise representations of powers of 10. In this case using a an interval arithmetic library e.g. to represent the powers of 10 would be a good solution.

Best regards,

Michael
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

[-- Attachment #2: Type: text/html, Size: 3829 bytes --]

      parent reply	other threads:[~2016-10-26  8:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-24 14:01 Tung Vu Xuan
2016-10-25 10:21 ` Jacques-Henri Jourdan
2016-10-25 11:20 ` Soegtrop, Michael
2016-10-25 11:24   ` Soegtrop, Michael
2016-10-25 14:19   ` Jacques-Henri Jourdan
2016-10-25 15:28     ` Soegtrop, Michael
2016-10-25 16:58       ` Tung Vu Xuan
2016-10-25 17:04         ` Jacques-Henri Jourdan
2016-10-25 18:07         ` Xavier Leroy
2016-10-26  9:38           ` Tung Vu Xuan
2016-10-26  8:08         ` Soegtrop, Michael [this message]

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=0F7D3B1B3C4B894D824F5B822E3E5A172CFA08CF@IRSMSX102.ger.corp.intel.com \
    --to=michael.soegtrop@intel.com \
    --cc=caml-list@inria.fr \
    --cc=toilatung90@gmail.com \
    /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 NNTP newsgroup(s).