Skip to content

A complex number made with downcasting off prints as a different number once downcasting is back on #1610

Closed

Description

@Rafael-SOWNet

What you ran:

Entity.Number.Complex z;
using (MathS.Settings.DowncastingEnabled.Set(false))
    z = Entity.Number.Complex.Create(EDecimal.FromString("1"), EDecimal.FromString("-0.3333333333333333333333333333333333333333"));
Console.WriteLine(z);

What it did: Printed 1 - 1/3i. The parser reads that back as 1 - 1/(3i), which is 1 + i/3. Printed inside the scope, the same number is 1 - 0.3333333333333333333333333333333333333333i. A small imaginary part is lost altogether: erfc(16 - 0.5i), evaluated with downcasting off, prints as -2.8337...E-113 - 0i, though its imaginary part is -9.4899...E-114. Latexize does the same.

What it should have done: Print the number it holds, whatever the setting is when it is printed.

Activity

  1. added this to the 2.6.0 milestone on Sep 30, 2026
  2. added a commit that references this issue on Sep 30, 2026
    429ace7
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions