I have this snippet with a strange result (279.1 ... versus 279.6 ...):
$ perl -e "print unpack('f>', pack ('f>', 279.117156982422));" 279.617156982422
While this one works
$ perl -e "print unpack('f>', pack ('f>', 279.117256982422));" 279.117248535156
And those and others
$ perl -e "print unpack('f<', pack ('f<', 279.117156982422));" 279.11715698242 $ perl -e "print unpack('f', pack ('f', 279.117156982422));" 279.117156982422
What happened? Is this an error when unpacking unsaturated floating point values?
Note. Perl is version 5.14.2 under Cygwin on PC.
source share