[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
[an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]![]() |
![]() |
![]() |
|||||||||||||||||||||||||
|
|||||||||||||||||||||||||||
![]() |
![]() |
![]() |
Adam Sjøgren wrote: > On Wed, 06 Jul 2005 18:45:34 +0200, Rune wrote: > >> Jeg har gemt en fil fra et C-program hvor jeg har gemt en masse floats. >> Før jeg gemte floats'ne konverterede jeg dem med reinterpret_cast<long> >> og derefter med ntohl for at få gemt dem som big-endian. Kan man i perl >> trække dataen ud igen dvs anvende hvad der svarer til htonl og derefter >> reinterpret_cast<float> ? > > Måske ved hjælp af 'pack'/'unpack'? > > Alt efter hvad din definition af "en masse" er, kan det være nemmere > at lave et C-program der spytter tallene ud i plain text - da perldoc > -f pack si'r: > > "* Real numbers (floats and doubles) are in the native > machine format only; due to the multiplicity of floating > formats around, and the lack of a standard "network" > representation, no facility for interchange has been made. > This means that packed floating point data written on one > machine may not be readable on another - even if both use > IEEE floating point arithmetic (as the endian-ness of the > memory representation is not part of the IEEE spec). See > also perlport." > > > Mvh. > Jeg tror jeg laver et lille c-program. Tak for den hurtige hjælp
![]() |
![]() |
![]() |
||||||||||||
|
||||||||||||||
![]() | ||||||||||||||
|
||||||||||||||
![]() |
![]() |
![]() |