Razenpok / BreakInfinity.cs

Double replacement for numbers that go over 1e308
MIT License
212 stars 33 forks source link

Some things that don't work in Unity/C# 6.0 #1

Closed Patashu closed 5 years ago

Patashu commented 5 years ago

1) you can't do 'other is BigDouble bigDouble'. you have to replace it with a separate is and a cast later. happens in Equals and CompareTo 2) 'Random' is ambiguous between System.Random and UnityEngine.Random. fix by changing it to 'private static readonly System.Random Random = new System.Random();' 3) you can't do 'out var formatDigits'. have to separately declare int formatDigits and then out to it.

based on a conversation with Wild Obunga in #modification on AD server. since a primary reason to make this library is for use in Unity games, this seems pretty important to do.

https://github.com/Patashu/break_infinity.js/commit/0ba078baca0ad1761103907a34c1268f0e5f6f53#diff-6a117233d5fa57db6c21ce175ef40e1c

Razenpok commented 5 years ago

Hi, future me

Don't forget to add ++ and -- operator overloads