- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
An afterthought ;
Why not use REAL(16) arithmetic to calculate that?
We are always guaranteed to get the correct answer for ANY combination of inputs,
and the most extreme range (-huge to +huge)
You get a REAL(16) result, which you would round off to get the final number.
NO_STEPS = (real(STOP,16) - real(start,16)+real(step,16))/real(step,16)
Since the compiler supports REAL(16) arithmetic, this should not cause any problems.
Anyway, I wanted to see what the compiler guys think about this, since it completely
avoids the integer overflow curse.
Link Copied
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In Quote #13 I gave a method which DOES NOT USE higher order arithmetic.
It does, however, have an extra divide, and a couple of extra adds.
Basically, it splits the problem into two parts.
You would not need to use it if START and STOP have the same sign, however.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can't help myself - no offense, but when I read:
"Now of course, those limits have to be really large numbers for that to occur, but who is to say that a given application would NEVER run into that situation?"
I immediately thought of an expression we have in Dutch, somewhat freely translated: If the sky falls, we will all wear a blue hat.
I do not know the English equivalent, but I guess, you can tell the meaning ;).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
arjenmarkus wrote:
"If the sky falls, we will all wear a blue hat."
That is so apt! My favorite, very useful when helping someone debug their code, is "De aap komt uit de mouw!", which is even less translatable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You may like this one too: "Let op het springen van de lintwurm!"
Literally: "Watch the jumping of the tapeworm", used when you are about to confirm something you anticipated to happen. Don't ask me where it comes from :).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey, I wear a BROWN hat -
You never know what could be raining down upon you. . . .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did I "get in dutch" for that?
We ARE SPEAKING Dutch, aren't we?

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »