schemedoc / surveys

Scheme Surveys
https://docs.scheme.org/surveys/
MIT License
8 stars 3 forks source link

Add complex-abs.md #50

Closed jpellegrini closed 10 months ago

jpellegrini commented 10 months ago

This one is very interesting!

What is the result of (abs -3-4i)?

Some systems will complain that the argument is not real; some will compute the complex norm; and some will make some other decision, such as return the argument unchanged or take the absolute value of the real part only.

lassik commented 10 months ago

Thanks! Interesting indeed.

Is there a mathematical principle by which the absolute value of a complex number should be the number itself?

lassik commented 10 months ago

https://docs.scheme.org/surveys/complex-abs/

jpellegrini commented 10 months ago

Is there a mathematical principle by which the absolute value of a complex number should be the number itself?

Not that I know of. There could be several different functions for "distance" so several different possible "absolute values", but I don't recall any one which would end up in absolute value being the identity. But I had no coffee yet today, so I can be pathetically wrong on any subject... :smile: