Common Lisp Package: COM.INFORMATIMAGO.COMMON-LISP.CESARUM.FLOAT-BINIO

This package encodes and decodes arrays of float into arrays of signed-byte 32 in order to do binary I/O. BUGS: Handling of SHORT-FLOAT and LONG-FLOAT is not complete. License: AGPL3 Copyright Pascal J. Bourguignon 2003 - 2012 This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>

README:

FUNCTION

Public

BIOFA-COUNT (BIOFA-ARRAY)

RETURN: The number of floats encoded into the biofa-array.

BIOFA-DECODE (BIOFA-ARRAY)

RETURN: AN ARRAY OF FLOAT (DEPENDING ON BIOFA-FLOAT-SIZE AND +FLOAT-TYPE+) CONTAINING THE SAME VALUE AS ENCODED INTO BIOFA-ARRAY.

BIOFA-ENCODE (FLOAT-ARRAY)

RETURN: An array of (SIGNED-BYTE 32) or of containing the data from FLOAT-ARRAY.

BIOFA-REF (BIOFA-ARRAY INDEX)

RETURN: The float at INDEX.

BIOFA-SETREF (BIOFA-ARRAY INDEX FVALUE)

POST: (= (biofa-ref biofa-array index) fvalue)

Private

BIOFA-FLOAT-SIZE (BIOFA-ARRAY)

PRIVATE RETURN: THE NUMBER OF (SIGNED-BYTE 32) NEEDED TO STORE THE MANTISSA OF THE FLOATS STORED IN BIOFA-ARRAY.

BIOFA-RADIX (BIOFA-ARRAY)

PRIVATE RETURN: The radix used to decode/encode that BIOFA-ARRAY.

BIOFA-SET-FLOAT-SIZE (BIOFA-ARRAY FLOAT-SIZE)

PRIVATE POST: (= (BIOFA-FLOAT-SIZE BIOFA-ARRAY) FLOAT-SIZE)

BIOFA-SET-RADIX (BIOFA-ARRAY RADIX)

PRIVATE RETURN: The radix used to decode/encode that BIOFA-ARRAY.

FLOAT-SIZE (FVALUE)

PRIVATE RETURN: THE NUMBER OF (SIGNED-BYTE 32) NEEDED TO STORE THE MANTISSA OF FVALUE.

Undocumented

TEST

MACRO

Private

BIOFA-FETCH (BIOFA-ARRAY RADIX FLOAT-SIZE TYPE BASE)

PRIVATE

BIOFA-STASH (BIOFA-ARRAY FLOAT-SIZE BASE FVALUE)

PRIVATE

VARIABLE

Private

+FLOAT-TYPES+

AN A-LIST MAPPING FLOAT-SIZE TO FLOAT TYPE.

Undocumented

FDTEST

FSTEST

LDTEST

LSTEST

CONSTANT

Private

+HEADER-SIZE+

NUMBER OF HEADER ELEMENTS IN A BIOFA ARRAY