e$B0J2<$N$h$&$K!"e(Bprintf e$B$Ge(B NaN, Inf e$B$Ge(B 0 padding
e$B$,5/$3$j$^$9!#e(B
% ./ruby -ve ‘printf “[%08f]\n”, 0.0/0.0’
ruby 1.9.0 (2008-03-06 revision 15699) [i686-linux]
[00000NaN]
% ./ruby -e ‘printf “[%08f]\n”, 1.0/0.0’
[00000Inf]
% ./ruby -e ‘printf “[%08f]\n”, -1.0/0.0’
[-0000Inf]
e$B$7$+$7!"e(BC e$B$N5,3J$G$Oe(B NaN e$B$He(B Inf e$B$K4X$7$F$Oe(B 0
padding e$B$O5/$3e(B
e$B$j$^$;$s!#<B:]!"e(Bglibc e$B$G$O$=$&$J$j$^$9!#e(B
% uname -srv
Linux 2.6.18-5-686 #1 SMP Mon Dec 24 16:41:07 UTC 2007
% cat tst.c
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char **argv)
{
printf("[%08f]\n", 0.0/0.0);
printf("[%08f]\n", 1.0/0.0);
printf("[%08f]\n", -1.0/0.0);
return 0;
}
% gcc tst.c
% ./a.out
[ nan]
[ inf]
[ -inf]