XLISP write-float

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference

# write-float

Type: | - | function (subr)
Source: | - | xlfio.c

## Syntax

(write-float float [stream [length]])
  float - the floating point number to write
  stream - the output stream [default is standard output]
  length - the length of the float in bytes [default is 4, legal values are -4, -8, 4, and 8]
  returns - the float

## Description

The 'write-float' function writes a binary floating point number to an output stream, created by the open-binary function.

Note: Integers and floats are assumed to be big-endian [high-order byte first] and signed, regardless of the platform. To read little-endian format, use a negative number for the length, e.g. '-4' indicates a 4-bytes, low-order byte first. The file should be opened in binary mode.

## Examples

See also read-int, write-int, read-float, bigendianp, open-binary.

Back to Top

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference