Group Abstract Group Abstract

Message Boards Message Boards

A simple quadratic equation cannot be solved?

Posted 3 years ago
POSTED BY: Werner Geiger
6 Replies
POSTED BY: Michael Rogers

A dirty workaround is:

  Solve[eqn == 0, x]

without Reals in Solve.

POSTED BY: Mariusz Iwaniuk
POSTED BY: Gianluca Gorni
Posted 3 years ago

I know, Gianluca. I prefer Echo since it makes the code and the output more readable. And since I can easily disable it globally by:

$ContextPath = Prepend[$ContextPath, "myContext`"];
Echo[any___] := Null;

Actually I use my own echo-function with takes a global variable testLvl that controls which Echo-output shall be produced.

POSTED BY: Werner Geiger

I noticed that you use the construct

Echo[something];

I think you can save some typing with a simple

something

without the semicolon.

The semicolon suppresses the output, and Echo undoes the suppression. My suggestion is to suppress both semicolon and Echo.

POSTED BY: Gianluca Gorni
Posted 3 years ago

This works indeed, Mariusz (within 0,06 secs). But why? I had never thought that solving in Complex would be easier than within Reals. But anyway this is a valid solution. I can apply the Reals-condition later to the result.

POSTED BY: Werner Geiger
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard