Click here to Skip to main content
15,887,328 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: C++ integer arithmetic overflow - danger, danger Pin
jmaida6-Oct-23 16:15
jmaida6-Oct-23 16:15 
GeneralRe: C++ integer arithmetic overflow Pin
Member 133016798-Oct-23 21:42
Member 133016798-Oct-23 21:42 
GeneralRe: C++ integer arithmetic overflow Pin
Martijn Smitshoek9-Oct-23 9:19
Martijn Smitshoek9-Oct-23 9:19 
GeneralRe: C++ integer arithmetic overflow Pin
jeron16-Oct-23 4:54
jeron16-Oct-23 4:54 
GeneralRe: C++ integer arithmetic overflow Pin
OriginalGriff6-Oct-23 4:55
mveOriginalGriff6-Oct-23 4:55 
GeneralRe: C++ integer arithmetic overflow Pin
PIEBALDconsult6-Oct-23 6:04
mvePIEBALDconsult6-Oct-23 6:04 
GeneralRe: C++ integer arithmetic overflow Pin
k50546-Oct-23 6:13
mvek50546-Oct-23 6:13 
GeneralRe: C++ integer arithmetic overflow Pin
jschell6-Oct-23 7:23
jschell6-Oct-23 7:23 
Requirements, architecture and design.

So no detection but prevention. The business domain can insure that large sets cannot exist.

Then from that there might be limited sets with the potential. So one must analyze the problem to insure the following.
1. Can it occur at all?
2. What is the timeline for when it can occur? 1 year? 10 years? 50 years?

Myself I do not even attempt to program for long term problems which do not exist now. History does not suggest that doing that leads to better solutions - just ones that are more complex and harder to maintain.

If I find that it can occur now then I use a solution that allows for that actually handles large numbers. There are multiple libraries that provide large number handling.
GeneralRe: C++ integer arithmetic overflow Pin
RedDk6-Oct-23 8:11
RedDk6-Oct-23 8:11 
GeneralRe: C++ integer arithmetic overflow Pin
0x01AA6-Oct-23 8:35
mve0x01AA6-Oct-23 8:35 
JokeRe: C++ integer arithmetic overflow Pin
Nelek6-Oct-23 8:55
protectorNelek6-Oct-23 8:55 
JokeRe: C++ integer arithmetic overflow Pin
0x01AA6-Oct-23 9:06
mve0x01AA6-Oct-23 9:06 
GeneralRe: C++ integer arithmetic overflow Pin
Nelek6-Oct-23 9:10
protectorNelek6-Oct-23 9:10 
GeneralRe: C++ integer arithmetic overflow Pin
0x01AA6-Oct-23 9:16
mve0x01AA6-Oct-23 9:16 
GeneralRe: C++ integer arithmetic overflow Pin
Member 133016799-Oct-23 0:46
Member 133016799-Oct-23 0:46 
GeneralRe: C++ integer arithmetic overflow Pin
JSilvers9-Oct-23 8:07
professionalJSilvers9-Oct-23 8:07 
GeneralRe: C++ integer arithmetic overflow Pin
Lurk9-Oct-23 7:07
Lurk9-Oct-23 7:07 
GeneralRe: C++ integer arithmetic overflow Pin
Martijn Smitshoek9-Oct-23 9:30
Martijn Smitshoek9-Oct-23 9:30 
GeneralRe: C++ integer arithmetic overflow Pin
David On Life9-Oct-23 12:59
David On Life9-Oct-23 12:59 
GeneralRe: C++ integer arithmetic overflow Pin
BernardIE531710-Oct-23 4:31
BernardIE531710-Oct-23 4:31 
GeneralRe: C++ integer arithmetic overflow Pin
__Tobias__24-Oct-23 1:33
__Tobias__24-Oct-23 1:33 
RantHead bang moment. Pin
GKP19926-Oct-23 1:00
professionalGKP19926-Oct-23 1:00 
GeneralRe: Head bang moment. Pin
raddevus6-Oct-23 2:44
mvaraddevus6-Oct-23 2:44 
GeneralRe: Head bang moment. Pin
kmoorevs6-Oct-23 4:46
kmoorevs6-Oct-23 4:46 
GeneralRe: Head bang moment. Pin
Greg Utas6-Oct-23 4:56
professionalGreg Utas6-Oct-23 4:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.