Skip to content

v: support -div-by-zero-is-zero, which allows for x / 0 == 0, x % 0 == x, avoiding division by zero traps/panics#24981

Merged
spytheman merged 7 commits into
vlang:masterfrom
spytheman:impl_div_by_zero_is_zero
Jul 28, 2025
Merged

v: support -div-by-zero-is-zero, which allows for x / 0 == 0, x % 0 == x, avoiding division by zero traps/panics#24981
spytheman merged 7 commits into
vlang:masterfrom
spytheman:impl_div_by_zero_is_zero

Conversation

@spytheman

@spytheman spytheman commented Jul 26, 2025

Copy link
Copy Markdown
Contributor
  • v: support -div-by-zero-is-zero, which allows for x / 0 == 0, avoiding division by zero traps/panics
  • add a description for the new -div-by-zero-is-zero option to vlib/v/help/build/build-c.txt

@huly-for-github

Copy link
Copy Markdown

Connected to Huly®: V_0.6-23460

@spytheman spytheman changed the title impl div by zero is zero v: support -div-by-zero-is-zero, which allows for x / 0 == 0, avoiding division by zero traps/panics Jul 26, 2025
@spytheman spytheman changed the title v: support -div-by-zero-is-zero, which allows for x / 0 == 0, avoiding division by zero traps/panics v: support -div-by-zero-is-zero, which allows for x / 0 == 0, avoiding division by zero traps/panics Jul 26, 2025
@spytheman spytheman force-pushed the impl_div_by_zero_is_zero branch from 233b7fd to 79e90b5 Compare July 26, 2025 14:55
@spytheman spytheman changed the title v: support -div-by-zero-is-zero, which allows for x / 0 == 0, avoiding division by zero traps/panics v: support -div-by-zero-is-zero, which allows for x / 0 == 0, x % 0 == x, avoiding division by zero traps/panics Jul 27, 2025
Comment thread vlib/v/help/build/build-c.txt Outdated
Comment thread vlib/v/gen/c/testdata/div_by_zero_is_zero.c.must_have
@spytheman spytheman merged commit a5f9899 into vlang:master Jul 28, 2025
80 checks passed
@spytheman spytheman deleted the impl_div_by_zero_is_zero branch July 28, 2025 07:41
Krchi pushed a commit to Krchi/v that referenced this pull request Jul 28, 2025
…`x % 0 == x`, avoiding division by zero traps/panics (vlang#24981)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants