Repository navigation
Done
Done
Copy link
Labels
C# -> VBSpecific to C# -> VB conversionGood for coding agentCoding agent might get it in one - small change with reprooutput logic errorA bug where the converted output behaves differently to the input code
Description
Input code
using System;
public partial class A
{
public static void Main()
{
double foo = 0.6d;
int bar = (int)foo;
int baz = (int)Math.Ceiling(foo);
Console.WriteLine(bar);
Console.WriteLine(baz);
}
}Produces:
0
1
Erroneous output
Imports System
Public Partial Class A
Public Shared Sub Main()
Dim foo = 0.6R
Dim bar As Integer = foo
Dim baz As Integer = Math.Ceiling(foo)
Console.WriteLine(bar)
Console.WriteLine(baz)
End Sub
End ClassProduces:
1
1
Expected output
Imports System
Public Partial Class A
Public Shared Sub Main()
Dim foo = 0.6R
Dim bar As Integer = Math.Truncate(foo)
Dim baz As Integer = Math.Ceiling(foo)
Console.WriteLine(bar)
Console.WriteLine(baz)
End Sub
End ClassProduces:
0
1
Details
- Product in use: icsharpcode.github.io/CodeConverter
Reverse conversion of #1020
Reacted by Graham
Metadata
Metadata
Assignees
Labels
C# -> VBSpecific to C# -> VB conversionGood for coding agentCoding agent might get it in one - small change with reprooutput logic errorA bug where the converted output behaves differently to the input code
Activity
Truncate towards zero when casting a fractional number to an integer - …