E
Enrique Cruiz
Hi guys,
I use LUTs to accelerate certain parts of my app. The LUTs contain
float numbers, and I generated the numbers very precisely, up to 10
decimals. All seems fine, however, when I printf the numbers in the
LUT, I do not get the same exact numbers. The first 6 decimals are ok,
but it got beserk after that. To illustrate further:
float myLUT = [0.123456789, 0.123456789, 0.123456789, ................] ;
printf("myLUT: .10f", myLUT[1]);
##### output
myLUT: 0.123456111
I am not quite sure why that is the case, although I believe float do
not have enough precision, so the compiler (VC 8) gives the closest
approximation that can be had with float. Is that so? Can somebody
enlighten me on that issue?
Thanks in advance,
Enrique
I use LUTs to accelerate certain parts of my app. The LUTs contain
float numbers, and I generated the numbers very precisely, up to 10
decimals. All seems fine, however, when I printf the numbers in the
LUT, I do not get the same exact numbers. The first 6 decimals are ok,
but it got beserk after that. To illustrate further:
float myLUT = [0.123456789, 0.123456789, 0.123456789, ................] ;
printf("myLUT: .10f", myLUT[1]);
##### output
myLUT: 0.123456111
I am not quite sure why that is the case, although I believe float do
not have enough precision, so the compiler (VC 8) gives the closest
approximation that can be had with float. Is that so? Can somebody
enlighten me on that issue?
Thanks in advance,
Enrique