jwesley wrote:
> I think I've found a bug in the sprintf function:
> 
> D:\src\ruby>ruby -v
> ruby 1.8.2 (2004-12-25) [i386-mswin32]
> 
> D:\src\ruby>irb
> irb(main):001:0> sprintf("%.1f", 123456789012345678.to_f)
> => "123456789012345680.0"
> irb(main):002:0> sprintf("%.1f", 123456789012345678.to_f).to_i
> => 123456789012345680
> 
> Notice that that sprintf changed the value by an order of magnitude...
> 
> Justin

Nope, not a Ruby bug:

/* Solaris 10 */
#include <stdio.h>

int main(){
    printf("%.1f\n", 123456789012345678.0);
    return 0;
}

djberge@~/programming/C-528>gcc -Wall -o printftest printftest.c
djberge@~/programming/C-529>./printftest
123456789012345680.0

Regards,

Dan