Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Is there Sign() function in x++ ?

(0) ShareShare
ReportReport
Posted on by 592

Hi guys,

If I have variable with a value with negative sign, and then when I have other variable, how to make this other variable have the same sign as the 1st variable in x++ ? Is there a Sign() function in x++ ?

Thanks

  • Verified answer
    huijij Profile Picture
    huijij 19,811 on at
    RE: Is there Sign() function in x++ ?

    Hi Voltes,

    Global class contains a sign function which you can refer to.

    5548644.png

  • Verified answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: Is there Sign() function in x++ ?

    Hi Lars Volt,

    Use Global::sign(real number);

    Thanks,

    Girish S.

  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,587 Super User 2024 Season 1 on at
    RE: Is there Sign() function in x++ ?

    I am not aware of sign function.

    For your requirement you can just give if condition and check if other variable is less or greater than 0 and make the present variable value accordingly.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,160 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans