web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Assignment or comparison loses precision

(0) ShareShare
ReportReport
Posted on by

Hi,

how do I get rid of this warning?
I use a standard method that returns an int64. I want to divide it by some other number and save the result as real (because a division can result in numbers behind the comma). Now I get this warning which I don't really understand.

int64 i = 123;

real j;

j = i / 5; //this line produces the warning

*This post is locked for comments

I have the same question (0)
  • Verified answer
    5400 Profile Picture
    7,162 on at

    You have to use

    j = any2real(I/5)

  • Community Member Profile Picture
    on at

    Thanks

  • Hariharans87 Profile Picture
    3 on at

    When you assign the value to different data type, you will get this type of error message.

    For example:

    int x = 10;

    real y;

    y = x;

    To solve this issue, we can use the functions like any2real, any2int (as per Bhasker Roy reply)

    y = any2real(x);

  • Community Member Profile Picture
    on at

    In my case i was expecting the issue using mod in an operation van using any2int the problem was solved 

    Multip = any2int(r mod 10) * Cont

  • Community Member Profile Picture
    on at

    hi ,'

    when i count the recid using count fn and try to print the count it throws the same error how to solve it

  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Have you tried using any2real, any2int functions as suggested by others. If they are not serving the purpose, please use int642str function.

    Eg: info(int642str(salesLine.RecId));

  • Community Member Profile Picture
    on at

    hi

     nktt.NKMobileNum = NKCustTable_NKMobileNum.text();

           nktt.NKCustName = NKCustTable_NKCustName.text();

           nktt.Tr_ID = nktt.RecId +1;//here the error comes..and tr_ID is type int

  • Community Member Profile Picture
    on at

    hi

    got the ans

    thank u

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans