beeware / voc

A transpiler that converts Python code into Java bytecode
http://beeware.org/voc
BSD 3-Clause "New" or "Revised" License
869 stars 518 forks source link

GSoC Proposal: Complete implementation of the math and cmath library #503

Closed AakashSasikumar closed 7 years ago

AakashSasikumar commented 7 years ago

Complete Implementation of math and cmath

Project Goal

The math library is one of the most commonly used libraries in python. With math being such a crucial aspect of coding everywhere and keeping the goal of VOC in mind, I am willing to devote my time to implement these two important libraries.

As of now, there are no implementations of these two libraries what so ever. I have planned to split the timeline into two; One-half for implementing cmath and the other for math.

Implementation

The math Library

In reference to the Python documentation, there is a total of 44 methods and 5 constants, out of which 22 methods and 3 constants do not translate directly to the java.lang.Math class.

Among the 23 methods and 3 constants, I have divided them into two parts,

The cmath Library

In reference to the python documentation of cmath, there is a total of 23 methods and 7 constants. Unfortunately, Java does not have a class for manipulating complex numbers. Therefore, all of the methods must be implemented from scratch.

The functions that have to be implemented are [phase()](), [polar()](), [rect()](), [exp()](), [log()](), [log10()](), [sqrt()](), [acos()](), [asin()](), [atan()](), [cos()](), [sin()](), [tan()](), [acosh()](), [asinh()](), [atanh()](), [cosh()](), [sinh()](), [tanh()](), [isfinite()](), [isinf()](), [isnan()](), and [isclose()]().

It is difficult to categorize these methods as they all require the same amount of work. They aren't too hard either; Most of them have direct formulas, other require a little bit more work.


Timeline


Community Bonding Period

Week 1: May 30 - June 2

Week 2: June 5 - 9

Week 3: June 12 - 16

Week 4: June 19 - 23

Week 5: June 26 - 30

Week 6: July 3 - 7

Week 7: July 10 - 14

Week 8: July 17 - 21

Week 9: July 24 - 28

Week 10: July 31 - August 4

Week 11: August 7 - 11

Week 12: August 14 - 18


About Me

I am an undergraduate student studying Computer Science, I have been coding from a very young age. I know Java very well, and I know the basics of Python. This is my first time applying for GSoC, honestly, I haven't dealt with open source organizations much. I see this as a great opportunity for me to get to know the world of python and open source. I come up with solutions fairly fast, maintaining my deadline wouldn't be much of a problem with me.

Contributions to VOC : PR #489

email - aakash3697@gmail.com

freakboy3742 commented 7 years ago

Unfortunately, this proposal wasn't accepted.