Remainder wat

deadalnix deadalnix at gmail.com
Mon Mar 5 03:01:40 PST 2012


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.


More information about the Digitalmars-d mailing list