Giter Site home page Giter Site logo

breakinfinity.cs's Issues

> comparison operator doesn't work when comparing finite number with exponent greater than 0 to positive infinity.

I am implementing a cap on a value using BigInteger.Min, using PositiveInfinity to essentially mean "no cap". However, I found that when the value reached 10 (which changed the exponent), Min would return that Infinity was the smaller value!

Min defers to the > operator, and the exponent for infinity is actually 0, where the line which perform the comparison is this:
if (a.Mantissa > 0) return b.Mantissa < 0 || a.Exponent > b.Exponent;
where a = 10 and b = Infinity.
Since the mantissa of a is 1 and larger than 0, the comparison is b.Mantissa < 0 (false) || a.Exponent (1) > b.Exponent (0) or false || true, thus, Infinity is smaller than 10.

How can I find a %?

I'm trying to use a bigdouble number in a progress bar but it might not be possible? I wanted to do something like this:

BigDouble num1 = 1000;
BigDouble num2 = 100;

BigDouble num3 = (num2 / num1) * 100;

int num4 = Convert.ToInt32(num3);
hp1.Value = num4;
hp1.Maximum = 100;

Is this even possible? I tried converting it to a string and then back, but the number gets too large.

  • If possible, would you mind showing me how? Thank you!

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

  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.

Patashu/break_infinity.js@0ba078b#diff-6a117233d5fa57db6c21ce175ef40e1c

Crash in Language Indonesia

There is a crash happened in Indonesia(Language) on Android when I called BigDouble.ToString() , I guess it caused by the defferent expression between Indonesia and others . By the way I found the 'formatprovider' is unused in BigNumber.FormatBigDouble(BigDouble value, string format, IFormatProvider formatProvider).

Heeey raza

How r u .,?
I wanna ask u
There is any way to send coins in my wallet plz image

Number incorrectly hits Infinity.

Number goes to Infinity after stage 5144. What am I doing wrong?

    public static BigDouble CalcEnemyHealth(int stage)
    {
        BigDouble x = BigDouble.Pow(1.35, Mathf.Min(stage - 1, 65));
        BigDouble y = BigDouble.Pow(1.15, Mathf.Max(stage - 65, 0));

        Debug.Log(y.ToString("E3"));

        return BigDouble.Multiply(15, BigDouble.Multiply(x, y));
    }

Stage 5143 will display 1.674E+308 here but stage 5144 will display NaNE+0. The returned value will show Infinity at stage 5144.

Exponent might be wrong

While trying out this package I noticed that the exponents don't seem to be working as expected. Typing '1000' into the left field in the Unity Inspector yields a value of 1e6, and typing '1000000' (1 million) yields a value of 1e21. I would imagine the expected values should be 1e3 and 1e6, respectively.

NotImplementedException: The method or operation is not implemented.

Hello
And I wanted to start adding numbers popped up error NotImplementedException: the method or operation is not implemented.
BreakInfinity.BigDouble.op_Explicit (BreakInfinity.BigDouble v)
and it doesn't add or display anything anywhere.
Here when I click on the error
public static explicit operator float(BigDouble v)
{
throw new NotImplementedException();
}

Max value of BreakInfinity.cs is actually 1e(9e18) rather than 1e(9e15)

Not really a big issue just more of an FYI since the readme only talks about the max of 1e(9e15) despite it going higher.
The MAX_SAFE_INTEGER for JavaScript is 9,007,199,254,740,991, but in C#, it uses a long, 9,223,372,036,854,775,807 which just has 3 more digits.
This means the max is around 9.99e9,223,372,036,854,775,806 (1 exponent below from infinity) or more simply, 1e(9e18)

BigDouble Array/List doesn't work in the editor

When setting up a BigDouble[] array SerializedField in a ScriptableObject, the inspector doesn't properly render the list, as shown below:

[SerializeField] public BigDouble[] CostList;

image

This is happening in Unity 2021.21f.

Any help will be greatly appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.