1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-07-01 13:56:00 +02:00

Add ability to get min/max values for generic floating point

This commit is contained in:
Ron Zuckerman 2024-02-09 18:52:32 -06:00
parent 484b9716db
commit af7ca28707
No known key found for this signature in database
GPG key ID: 7EC17CB87028ABF8
3 changed files with 23 additions and 2 deletions

View file

@ -10,11 +10,14 @@ namespace System
using System.Diagnostics;
#unwarn
public struct Double : double, IFloating, ISigned, IFormattable, IHashable, ICanBeNaN, IParseable<double>
public struct Double : double, IFloating, ISigned, IFormattable, IHashable, ICanBeNaN, IParseable<double>, IMinMaxValue<double>
{
public const double MinValue = -1.7976931348623157E+308;
public const double MaxValue = 1.7976931348623157E+308;
public static double IMinMaxValue<double>.MinValue => MinValue;
public static double IMinMaxValue<double>.MaxValue => MaxValue;
// Note Epsilon should be a double whose hex representation is 0x1
// on little endian machines.
public const double Epsilon = 4.9406564584124654E-324;