Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complex Numbers Extension #1861

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Complex Numbers Extension #1861

wants to merge 5 commits into from

Conversation

BonesYT
Copy link

@BonesYT BonesYT commented Jan 11, 2025

I couldn't find an extension dedicated to complex numbers, you know... sqrt(-1) and stuff like that, so I made one.
This is also my first extension, and it kinda works pretty well!

All features:

  • Construct a complex number with real and/or imaginary component

  • Get the real and imaginary components of that value

  • Boolean to check if a number is real or not

  • Addition, subtraction, multiplication, division and exponentiation. And modulo.

  • Functions with single input, with extra: conjugate, flip, sign, atan2.

  • Toggle between simple and advanced syntax, for perfomance reasons. Maybe simple mode is at least slightly faster.

Examples

  1. Mandelbrot Set
    image
  2. Julia Set
    image

})(Scratch);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean format only works if the very last line is empty??????????????????????

@penta-quark-neutro
Copy link

Interesting, I also made one of the same thing, but for personal use.
Your extension is quite good, but slow.
It takes almost 2.57 seconds to exponentiate 1000000 complex numbers.
Approximately 4 times slower than mine.
I think you should optimize it.

@GarboMuffin GarboMuffin added pr: other Pull requests that neither add new extensions or change existing ones pr: new extension Pull requests that add a new extension and removed pr: other Pull requests that neither add new extensions or change existing ones labels Jan 13, 2025
GarboMuffin added a commit that referenced this pull request Jan 13, 2025
- fix breakage when diff contains very long line (#1861)
- unhardcode repository
- add more logging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: new extension Pull requests that add a new extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants