0

I have a python method that calculates value and returns it. The value is

CalcData = 3941269503L. 

It is only 32 bit. Yet this is typecasted to long implicitly (suffixed by L) and when I access this method in COM in other application , I get the Python int too large to convert to C long error. I even tried typecasting it into int,but no luck

1 Answer 1

2

The "long" C type is signed so the largest positive value it can store is 2,147,483,647. The error is indeed correct, it doesn't fit.

Try "unsigned long" and "UL" postfix on the constant.

Sign up to request clarification or add additional context in comments.

1 Comment

Yeah You are right, I dint realize whether it is signed or not

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.