Skip to content

Precision is being lost somewhere #602

Closed
Closed

Description

@WhiteBlackGoose
In[21:18:52] = MathS.Settings.DecimalPrecisionContext.Set(EContext(1000, ERounding.Hal

╭─Ok──────────────────────────────────────────────────────────────────────────────────╮
│ AngouriMath.Convenience.Setting`1+AutoBackRollableTemporarySettingUnit[             │
│ PeterO.Numbers.EContext]                                                            │
╰─────────────────────────────────────────────────────────────────────────────────────╯

In[21:18:59] = "e ^ (-5.4 - 6.3 * 6.56)" |> eval

╭─Ok──────────────────────────────────────────────────────────────────────────────────╮
│ 0                                                                                   │
╰─────────────────────────────────────────────────────────────────────────────────────╯

Activity

  1. Rafael-SOWNet commented on Aug 5, 2026

    @Rafael-SOWNet
    Member

    Checked on current master with the same 1000-digit context from the report:

    MathS.Settings.DecimalPrecisionContext.Set(new EContext(1000, ERounding.HalfEven, -1000, 1000, false));
    "e ^ (-5.4 - 6.3 * 6.56)".EvalNumerical()
    => 5.0849589305248591296438415664064477213715544654835915860879989812686326416257...E-21
    

    which is the right value: the exponent is -46.728, and 10^(-46.728/ln(10)) is about 5.08e-21. The answer of 0 is gone. Closing.

  2. Rafael-SOWNet commented on Aug 5, 2026

    @Rafael-SOWNet
    Member

    Fixed on master. Under the same 1000-digit context from the report:

    MathS.Settings.DecimalPrecisionContext.Set(new EContext(1000, ERounding.HalfEven, -1000, 1000, false))
    "e ^ (-5.4 - 6.3 * 6.56)".EvalNumerical()
    => 5.0849589305248591296438415664064477213715544654835915860879989812686326416257128789932429345336662651135511050748629311768584574666707454052271029223590949211744882350780548575153916671192447363687200249369862821524469812300513600451959123464588134831002033566835307753706927934906162059761464021417610755393962746578632525756834846540664879536170104658395017683261610649111455351055303095460622069860864748678081781275062995080307255889695832619736307691230361227349610064182886451255121312022682254702180821081826246390802889521655931759195022830420890309330088164041957687649049268622977836023470195160162278314091729314063721523816803579033420239249911900954939165633805177380548247258724276086429224627081154284780002570095327870284208879179027580442597320770566383886577005257914490659064280482901404345037928386128839508296369995466854848383307368560788748114654369907105009060149768221489818433033386320054074923805931706414544427570515736556610026138912583870776569535368712716044908259311170E-21
    

    The 0 in the report came from the exponential's argument being rounded before the power was taken. Closing.

  3. added theissue type on Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions