S32K3 Floating point cfg

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K3 Floating point cfg

Jump to solution
113 Views
nirmal_masilamani
Contributor V

Hello Team,

In my project, i am trying to do arithmetic operation using float data, but calculation is not happening as expected.

#define macro -31.374

when i try to print in macro value using UTILS PRINTF, i am getting -32.374, similarly for other values, value get incremented by 1.

Because of this, my calculations not happening as expected.

Is there any cfg i need to do for this? 

My current target setting

nirmal_masilamani_0-1790009448678.png

 

Tags (2)
0 Kudos
Reply
1 Solution
77 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @nirmal_masilamani 

Could you please clarify what you mean by "UTILS PRINTF"?

How are you performing the calculations? Are the results stored in a float variable? If yes, does the variable already contain the wrong value when viewed in the debugger, or is the issue only observed when printing it?

 

BR, VaneB

View solution in original post

0 Kudos
Reply
2 Replies
78 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @nirmal_masilamani 

Could you please clarify what you mean by "UTILS PRINTF"?

How are you performing the calculations? Are the results stored in a float variable? If yes, does the variable already contain the wrong value when viewed in the debugger, or is the issue only observed when printing it?

 

BR, VaneB

0 Kudos
Reply
23 Views
nirmal_masilamani
Contributor V

Hello @VaneB ,

Thank you for your support, yes issue was in PRINTF function, while debugging i was able to read the proper data.

 

Tags (1)
%3CLINGO-SUB%20id%3D%22lingo-sub-2415030%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K3%20Floating%20point%20cfg%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2415030%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20Team%2C%3C%2FP%3E%3CP%3EIn%20my%20project%2C%20i%20am%20trying%20to%20do%20arithmetic%20operation%20using%20float%20data%2C%20but%20calculation%20is%20not%20happening%20as%20expected.%3C%2FP%3E%3CP%3E%3CSTRONG%3E%23define%20macro%20-31.374%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3Ewhen%20i%20try%20to%20print%20in%20macro%20value%20using%20UTILS%20PRINTF%2C%20i%20am%20%3CSTRONG%3Egetting%20-32.374%2C%3C%2FSTRONG%3E%20similarly%20for%20other%20values%2C%20value%20get%20incremented%20by%201.%3C%2FP%3E%3CP%3EBecause%20of%20this%2C%20my%20calculations%20not%20happening%20as%26nbsp%3Bexpected.%3C%2FP%3E%3CP%3EIs%20there%20any%20cfg%20i%20need%20to%20do%20for%20this%3F%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20current%20target%20setting%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22nirmal_masilamani_0-1790009448678.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22nirmal_masilamani_0-1790009448678.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22nirmal_masilamani_0-1790009448678.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F396621i608D3FC50654D6D4%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22nirmal_masilamani_0-1790009448678.png%22%20alt%3D%22nirmal_masilamani_0-1790009448678.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3Enirmal_masilamani_0-1790009448678.png%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3Enirmal_masilamani_0-1790009448678.png%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2415047%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K3%20Floating%20point%20cfg%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2415047%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F233316%22%20target%3D%22_blank%22%3E%40nirmal_masilamani%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECould%20you%20please%20clarify%20what%20you%20mean%20by%20%22UTILS%20PRINTF%22%3F%3C%2FP%3E%0A%3CP%3EHow%20are%20you%20performing%20the%20calculations%3F%20Are%20the%20results%20stored%20in%20a%20float%20variable%3F%20If%20yes%2C%20does%20the%20variable%20already%20contain%20the%20wrong%20value%20when%20viewed%20in%20the%20debugger%2C%20or%20is%20the%20issue%20only%20observed%20when%20printing%20it%3F%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBR%2C%20VaneB%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2415429%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K3%20Floating%20point%20cfg%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2415429%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F201913%22%20target%3D%22_blank%22%3E%40VaneB%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3EThank%20you%20for%20your%20support%2C%20yes%20issue%20was%20in%20PRINTF%20function%2C%20while%20debugging%20i%20was%20able%20to%20read%20the%20proper%20data.%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E