Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 951327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:43:05+00:00 2026-05-15T23:43:05+00:00

In my CPP file I have a call that is: pt.x = mDownPoint.x +

  • 0

In my CPP file I have a call that is:

pt.x = mDownPoint.x + FSign(pt.x-mDownPoint.x) *
        FMax( FAbs(pt.x-mDownPoint.x), FAbs(pt.y-mDownPoint.y) );

I get compiler errors for FSign, FMax, FAbs, but I include the header file where they are at.

So I don’t see why it would not find it, unless I have done something wrong in the creation of this header file.

Can I get some pointers on what I am doing wrong?

Header:

class FxMathFunctions
{
struct FxPoint2d;

public:
    FxMathFunctions();
    ~FxMathFunctions();

    static FxInt32 IMin(FxInt32 i1,FxInt32 i2);
    static FxInt32 IMax(FxInt32 i1,FxInt32 i2);
    static FxInt32 ILimit(FxInt32 val, FxInt32 i1, FxInt32 i2);
    static FxDouble FMin(FxDouble i1,FxDouble i2);
    static FxDouble FMax(FxDouble i1,FxDouble i2);
    static FxFloat FMax(FxFloat i1,FxFloat i2);
    static FxFloat FLimit(FxFloat val, FxFloat i1, FxFloat i2);
    static FxDouble FrInverseContrast(FxDouble opacity,FxDouble antialias);
    static FxInt32 ISign(FxInt32 l);
    static FxFloat FSign(FxFloat v);
    static FxInt32 IAbs(FxInt32 l);
    static FxFloat FAbs(FxFloat v);
    static FxInt32 INonzero(FxInt32 l);
    static double DAbs(double v);
    static FxInt32 Sqr(FxByte v);
    static FxInt32 Sqr(FxInt32 v);
    static FxFloat Sqr(FxFloat v);
    static FxDouble Sqr(FxDouble v);
    static FxInt32 FrCubed(FxByte v);
    static FxInt32 FrCubed(FxInt32 v);
    static FxFloat FrCubed(FxFloat v);
    static FxDouble FrCubed(FxDouble v);
    static FxDouble FrFourthPower(FxDouble v);
    static FxFloat FrFourthPower(FxFloat v);
    static FxBool FNearEqual(FxFloat val, FxFloat nearTo, FxFloat closeness = 0.00001f);
    static FxBool FNearGreaterEqual(FxFloat val, FxFloat nearTo, FxFloat closeness = 0.00001f);
    static FxBool FNearLessEqual(FxFloat val, FxFloat nearTo, FxFloat closeness = 0.00001f);
};

.CPP to Header where applicable for one function that is failing:

FxFloat FAbs(FxFloat v)
{
    if (v < 0.0f) v = -v;
    return v;
}

EDIT:

Fixed call:

pt.x = mDownPoint.x + FxMathFunctions::FSign(pt.x-mDownPoint.x) * 
                FxMathFunctions::FMax( FxMathFunctions::FAbs(pt.x-mDownPoint.x),
                FxMathFunctions::FAbs(pt.y-mDownPoint.y) );

Failing with:

error: cannot call member function ‘FxFloat FxMathFunctions::FAbs(FxFloat)’

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:43:05+00:00Added an answer on May 15, 2026 at 11:43 pm

    All the function are within FxMathFunctions, so it should be:

    pt.x = mDownPoint.x + FxMathFunctions::FSign(pt.x-mDownPoint.x) *
            FxMathFunctions::FMax( FxMathFunctions::FAbs(pt.x-mDownPoint.x), 
            FxMathFunctions::FAbs(pt.y-mDownPoint.y) );
    

    But this is what namespaces are for, I don’t think you actually want a class. If it’s a namespace, you can even do using namespace FxMathFunctions; at the top of the function your code is in and leave the code you have in the question.


    Secondly, a lot of those functions don’t need to be written, unless you’ve gotten some hand-written implementation of them. (Just use cmath and utility, for things like std::fabs and std::min.) Lastly, why not overload FAbs and DAbs to just Abs, like you do for Sqr? It would make the interface simpler.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.