From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c705819cb47d80d9 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news.germany.com!newsfeed.utanet.at!newsfeed01.chello.at!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Q: Portable Ada floating-point binary I/O ? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <44f09ac3$1_3@news.bluewin.ch> Date: Sat, 26 Aug 2006 22:42:04 +0200 Message-ID: NNTP-Posting-Date: 26 Aug 2006 22:41:46 CEST NNTP-Posting-Host: c9f7ca99.newsspool3.arcor-online.net X-Trace: DXC=BZ[:RQMcF=Q^Z^V3X4Fo<]lROoRQ4nDHegD_]RUQN; On Sat, 26 Aug 2006 21:02:47 +0200, Gautier wrote: > Does somebody know about a way of doing floating-point I/O which > is portable across architectures (endianesses etc.) and a little > bit more compact than the representation with digits ? For network communications we send binary exponent and mantissa as signed integers and then assemble them using corresponding floating-point attributes. Integers are sent in a variable length format, which along with a moderate compression effect, allows us to vary the mantissa length. So it becomes independent on how many bits the mantissa has on the given host. However, the problem is - what does "portable" mean here? Range and precision cannot be portable, unless types aren't communicated as well. > If yes, is there an open-source Ada package doing it ? Alas, it isn't. But it is easy to implement. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de