Re: Problems with C floats
- Posted by jimcbrown (admin) Jan 30, 2010
- 2503 views
mattlewis said...
irv said...
puts(1, "\n> printf test:\n") s = define_c_proc(libc, "printf", {C_POINTER, C_INT, C_DOUBLE, C_INT, C_FLOAT}) format = allocate_string("Here are 4 numbers: %d, %.3f, %d, %e\n") c_proc(s, {format, 111, 222.222, 333, 444.4444})
I think that printf expects a double float (64-bits) with the %f format.
Matt
The test used %e format, not %f format.
But OTOH I think all of printf's formats might expect doubles.. as I posted already in this thread.