Skip to content

VB.NET division / integer division #11

@zspitz

Description

@zspitz

VB.NET has two modes for division: simple division, which will return the same answer irrespective of type:

Dim i1 =11, i2 = 4
Dim result = i1 / i2
Console.WriteLine(result)
' prints 2.75

and integer division, which rounds the operands down or up, carries out the division, and rounds the answer again to an integer:

Dim i1 =11.0, i2 = 1.1
Dim result = i1 \ i2
Console.WriteLine(result)
' prints 11

Perhaps we should render the expression resulting from integer division differently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions