Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I encode and decode floats quickly, accurately, and without consing, for the purpose of sending them to a separate process?

0
Posted

How can I encode and decode floats quickly, accurately, and without consing, for the purpose of sending them to a separate process?

0

A 3.1-6) If it is necessary to be able to read the floats as floats either in lisp or in a different language, then it is hard to do efficiently; the algorithm for printing floats in scientific notation is designed to accurately convert to base 10 representation, but the price of this accuracy is time and consing. However, if the purpose of encoding and decoding these floats is simply to read them in again and create new floats in a different process (for example, a marshalling interface) then the following functions can be used. They are available for release 5.0 and 5.0.1 as patches and will be included in the next release. The patches are p2a004.001 (in 5.0.1) and p0a015.001 (in 5.0). The 16-bit values tend to be cons-free, and they can then either be used as raw data, or converted to a textual format such as hexadecimal, for the purpose of sending the data through an interface to another process. These numbers can then be read by the receiving process and can be used to reconstruct

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123