Answers for "Precision comparison in C#"

C#
0

Precision comparison in C#

using System;

float x = 1f / 3f;
double y = 1d / 3d;
decimal z = 1m / 3m;

Console.WriteLine(x); // 0.33333334
Console.WriteLine(y); // 0.3333333333333333
Console.WriteLine(z); // 0.3333333333333333333333333333
Posted by: Guest on October-13-2021

C# Answers by Framework

Browse Popular Code Answers by Language