Skip to content

Nested Math.Ceiling Math.Round etc does not work with C-sharp and Java #230

@mittelmark

Description

@mittelmark

Hi,

our project progresses fast ...

Here an issue we found with Java and C# if the Math statements are nested:

public static class Test {
        public static void Main (string[] argv) {
                int x = Math.Ceiling(1.0); // works on C, C++, C#, D, Java, Javascript, Python (Swift and Typescript untested) 
                List<int>() y;
                y.Add(Math.Ceiling(2.0)); // fail Java, C-sharp missing typecast to int
                Console.WriteLine($"x is {x}");
                Console.WriteLine($"y0 is {y[0]}");
        }
}

same issue with Math.Round etc.

Best,
Detlef

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions