fround command pic 24fFV
Posted: Fri Mar 15, 2024 1:09 am
Sir I am trying to use the fround command to limit a floating variable to 2 decimal places. It appears not to work in the simulation.
EMA_APHIA = 0.90
EMA_APHIA = fround (EMA_APHIA,2)
when I run the simulation I get 0.899999976------------lots more.
Does this command work in the simulation or only once complied?
While my program is not yet complete as I test each part as I go I have attached the flowcode file MAP_4CH_24FV_master_slave.fcfx
I have read the articles on the forum that tend to indicate the command does not work on 16bit PIC chips.
Can someone please enlighten me as to what I am doing wrong.
Thanks
EMA_APHIA = 0.90
EMA_APHIA = fround (EMA_APHIA,2)
when I run the simulation I get 0.899999976------------lots more.
Does this command work in the simulation or only once complied?
While my program is not yet complete as I test each part as I go I have attached the flowcode file MAP_4CH_24FV_master_slave.fcfx
I have read the articles on the forum that tend to indicate the command does not work on 16bit PIC chips.
Can someone please enlighten me as to what I am doing wrong.
Thanks