Skip to content

add compile error for division by zero #372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andrewrk opened this issue May 10, 2017 · 0 comments
Closed

add compile error for division by zero #372

andrewrk opened this issue May 10, 2017 · 0 comments
Labels
bug Observed behavior contradicts documented or intended behavior
Milestone

Comments

@andrewrk
Copy link
Member

comptime {
    const a: i32 = 1;
    const b: i32 = 0;
    const c = a / b;
}
zig build_obj test.zig

Currently gives "floating point exception". We already have a runtime safety check for this, we just need the compile error.

@andrewrk andrewrk added the bug Observed behavior contradicts documented or intended behavior label May 10, 2017
@andrewrk andrewrk added this to the 0.1.0 milestone May 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

No branches or pull requests

1 participant