strange float question !
Hey strengthstrong,
Do you mind sharing relevant code? We need more information.
Cheers,
Håkon.
Hey strengthstrong,
Do you mind sharing relevant code? We need more information.
Cheers,
Håkon.
float r = 0, g = 0, b = 0; int i = (int) fmod((p_hsb_h / 60), 6); NRF_LOG_RAW_INFO("i= %d\r\n",i); float f = (p_hsb_h / 60) - i;
With this relationship should be
This is not the code that produced the terminal output in the original post.
What on earth are you asking here? Would you post a proper question please. The code you've posted has nothing to do with the output at the top, nothing at all.
Post the code which generates that output, in full, and write more than 2 words of question about what it is you want to know.
And check the dev forums for hints about how to output floats, many of the printf() type functions don't actually support floats and just print 0.
And instead of using printf() debugging, use a debugger and LOOK at the numbers.
This is my program code, with NRF_LOG_INFO print, I would like to know what is the reason leading to 1-f = 0.0, you see, log print out f = 0.0