From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Banel Subject: Re: babel C, C++, D enhancement Date: Mon, 16 Jun 2014 22:49:06 +0200 Message-ID: <539F5842.2060209@free.fr> References: <878urc0zmw.fsf@bzg.ath.cx> <874n1ryeq1.fsf@bzg.ath.cx> <87y4xgxu74.fsf@Rainer.invalid> <87r438uycj.fsf@bzg.ath.cx> <538BA215.2050305@free.fr> <877g4uezak.fsf@gmail.com> <5394C55B.7010906@free.fr> <87tx7vq955.fsf@gmail.com> <87ha3p8fq9.fsf@Rainer.invalid> <539B762F.90406@free.fr> <878uowpv4b.fsf@Rainer.invalid> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wwdq7-0000ED-87 for emacs-orgmode@gnu.org; Mon, 16 Jun 2014 16:49:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wwdq1-0001jX-3L for emacs-orgmode@gnu.org; Mon, 16 Jun 2014 16:49:15 -0400 Received: from smtp6-g21.free.fr ([212.27.42.6]:48225) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wwdq0-0001j8-TF for emacs-orgmode@gnu.org; Mon, 16 Jun 2014 16:49:09 -0400 Received: from [IPv6:2a01:e35:2e21:def0:fdbc:d4f7:34a8:3c2b] (unknown [IPv6:2a01:e35:2e21:def0:fdbc:d4f7:34a8:3c2b]) by smtp6-g21.free.fr (Postfix) with ESMTP id A7CFA8225D for ; Mon, 16 Jun 2014 22:49:07 +0200 (CEST) In-Reply-To: <878uowpv4b.fsf@Rainer.invalid> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi Achim. You are right, INT_MAX is the C++ constant to compare to. It is defined in limits.h I'm not sure I want to locate limits.h (where is it ? are there several versions ?), and parse it, all from within Emacs-lisp... And this will have to be done for all languages (Python, Perl, Java, and so on), not just C++. Or we could assume that INT_MAX is always 2147483647. (Which of course is not true). Not so easy... Regards Thierry Le 16/06/2014 20:28, Achim Gratz a =E9crit : > Thierry Banel writes: >> So Babel C++ may cause problem for large integers. >> I am not sure how we can fix this in any case. > You'd need to know INT_MAX and give an error for larger values or use a= n > integral type that is large enough to handle Emacs' integer (which woul= d > most likely be necessary for any Emacs that uses wide integer). > >> In the meantime, we can force large values to be declared as doubles b= y >> adding dot zero >> like this: >> >> #+BEGIN_SRC C++ :var large=3D9876543210 .0 >> printf ("%g", large); >> #+END_SRC > That will lose precision, so it may not be the right thing either. > > > Regards, > Achim.