Skip to content

EgorBot for hez2010 in #112061 #285

@EgorBot

Description

@EgorBot

Processing dotnet/runtime#112061 (comment) command:

Command

-intel

using System.Numerics;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;

// Actual runner is optional, but if it exists, it has to be like this:
BenchmarkSwitcher.FromAssembly(typeof(Bench).Assembly).Run(args);

public class Bench
{
    private int v = 42;

    [Benchmark]
    public double GetDouble() => CastNumber<double>(this.v);

    static T CastNumber<T>(int v) where T : INumberBase<T>
    {
        return T.CreateTruncating(v);
    }
}

(EgorBot will reply in this issue)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions