Integer arithmetic in hardware descriptions

JanC usenet at janc.invalid
Sun Mar 15 23:38:04 EDT 2009


bearophileHUGS at lycos.com wrote:

> Some C# designers come from Pascal (where overflow is considered an
> important thing), and they have added to dotnet ways to find when an
> overflow occurs, globally in a program, locally in a piece of code, or
> even in a single part of an expression. This is much better than
> nothing.

> I'm fighting against the C/C++ crowd to add C#-like integer overflows
> to the D2 language, but with not much luck so far, all they (Walter,
> mostly) see is the "lower performance" it may lead.

In most "modern" Pascal dialects the overflow checks can be (locally)
enabled or disabled with compiler directives in the source code, so the
"speed issue" is not a real issue in practice...

<http://freepascal.org/docs-html/prog/progsu62.html#x69-670001.1.62>

This allows you to disable those checks in e.g. a very speed-sensitive piece
of code (that you must check for correctness yourself then of course, but
that's better than having to check *all* code).


-- 
JanC



More information about the Python-list mailing list