Skip to content

Allow float modulo for scalar-vector and vector-scalar #2450

Closed

Description

@amaiorano

Currently in the spec, division and modulo are non-orthogonal: float division is defined for scalar-vector and vector-scalar, but float modulo is not.

We can see this non-orthogonality in section [6.9. Arithmetic Expressions](6.9. Arithmetic Expressions):

For scalar-scalar and vector-vector, division and modulo are effectively the same:

image

But for mixed scalar-vector and vector-scalar, modulo is separate and only defined for i32 and u32:

image

Since we already define float modulo for scalar-scalar and vector-vector, why not define it for the mixed versions?

Activity

  1. added
    wgsl
    on Dec 22, 2021
  2. self-assigned this
    on Jan 11, 2022
  3. added this to the V1.0 milestone on Jan 11, 2022
  4. dneto0 commented on Jan 11, 2022

    @dneto0
    Contributor

    Discussed in 2022-01-11 meeting. bookmark
    Agreed to add this.

  5. added a commit that references this issue on Jan 11, 2022
    25451b5
  6. added a commit that references this issue on Jan 12, 2022
    d6e25f5
  7. kdashg commented on Jan 12, 2022

    @kdashg
    Contributor
    WGSL meeting minutes 2022-01-11
    • DM: Didn’t we have a reason for mod-float being different?
    • DN: We had concerns but we addressed those already.
    • MM: Our preference for consistency.
    • Spec needed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

wgsl

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions