Remainder wat

Martin Nowak dawg at dawgfoto.de
Mon Mar 5 07:01:46 PST 2012


On Mon, 05 Mar 2012 12:01:40 +0100, deadalnix <deadalnix at gmail.com> wrote:

> Le 05/03/2012 00:33, Adam D. Ruppe a écrit :
>> On Sunday, 4 March 2012 at 23:27:45 UTC, deadalnix wrote:
>>> I did, it doesn't address why in one case we have a floating point
>>> error, and in the other a divide error
>>
>> If you use literals, the compiler catches it at compile
>> time. "Error: divide by zero" happens when you run the
>> compiler.
>>
>> If not, the operating system catches it at runtime.
>> "Floating point exception" happens when you run the
>> program.
>>
>> There's nothing inconsistent about this; it is just
>> the difference between a compile time error and a
>> run time error.
>>
>
> The 0 is known at comile time. You should get the error at compile time.

The divide by zero is an error during constfolding not a specific compiler  
check.


More information about the Digitalmars-d mailing list