Warning: This is the manual of the legacy Guile 2.0 series. You may want to read the manual of the current stable series instead.

Next: , Previous: , Up: Bytevectors   [Contents][Index]


6.6.6.5 Interpreting Bytevector Contents as Floating Point Numbers

Bytevector contents can also be accessed as IEEE-754 single- or double-precision floating point numbers (respectively 32 and 64-bit long) using the procedures described here.

Scheme Procedure: bytevector-ieee-single-ref bv index endianness
Scheme Procedure: bytevector-ieee-double-ref bv index endianness
C Function: scm_bytevector_ieee_single_ref (bv, index, endianness)
C Function: scm_bytevector_ieee_double_ref (bv, index, endianness)

Return the IEEE-754 single-precision floating point number from bv at index according to endianness.

Scheme Procedure: bytevector-ieee-single-set! bv index value endianness
Scheme Procedure: bytevector-ieee-double-set! bv index value endianness
C Function: scm_bytevector_ieee_single_set_x (bv, index, value, endianness)
C Function: scm_bytevector_ieee_double_set_x (bv, index, value, endianness)

Store real number value in bv at index according to endianness.

Specialized procedures are also available:

Scheme Procedure: bytevector-ieee-single-native-ref bv index
Scheme Procedure: bytevector-ieee-double-native-ref bv index
C Function: scm_bytevector_ieee_single_native_ref (bv, index)
C Function: scm_bytevector_ieee_double_native_ref (bv, index)

Return the IEEE-754 single-precision floating point number from bv at index according to the host’s native endianness.

Scheme Procedure: bytevector-ieee-single-native-set! bv index value
Scheme Procedure: bytevector-ieee-double-native-set! bv index value
C Function: scm_bytevector_ieee_single_native_set_x (bv, index, value)
C Function: scm_bytevector_ieee_double_native_set_x (bv, index, value)

Store real number value in bv at index according to the host’s native endianness.