Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ π -¹ ² ³ °

You are not logged in.

- Topics: Active | Unanswered

**imcute****Member**- Registered: 2022-09-28
- Posts: 176

https://replit.com/@imcute-aaaa/Numbers#main.py(it doesn't seem to error now cuz i added that error term)

my ln results are all less than (if i should get result x,then it will be less 0.00000000076956675x)

or you can say that all my results are multiplied by 0.99999999923043323392556634123536

but why???(It's not a precision problem!i used my complex rational class which has infinite precision and the error term does not relate to the prec parameter other than going wrong under prec<10 and its not <10)

*Last edited by imcute (2022-12-30 12:44:24)*

Offline

**ganesh****Administrator**- Registered: 2005-06-28
- Posts: 41,270

Avoid external links like this: https://replit.com

It appears to me that if one wants to make progress in mathematics, one should study the masters and not the pupils. - Niels Henrik Abel.

Nothing is better than reading and gaining more and more knowledge - Stephen William Hawking.

Offline

**imcute****Member**- Registered: 2022-09-28
- Posts: 176

My code is in that link

Offline

**Bob****Administrator**- Registered: 2010-06-20
- Posts: 9,631

Hi imcute

I have added url /url code to your link address to make it easier to jump to.

That's a lot of code to analyse. Please help by explaining what the ode is for; and the algorithm you are attempting to code.

Thanks,

Bob

Ps replit is safe.

Children are not defined by school ...........The Fonz

You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei

Sometimes I deliberately make mistakes, just to test you! …………….Bob

Offline

**imcute****Member**- Registered: 2022-09-28
- Posts: 176

The relavent code are the log function in the num class

The other functions are fine.

Offline

**Bob****Administrator**- Registered: 2010-06-20
- Posts: 9,631

hi imcute

I'm flattered that you think I (or anyone else) could make sense of this as posted. I think the following is the minimum you need to back up your code:

(1) What you are trying to code in words.

(2) The algorithm(s) you are using (or a flow diagram, for example).

(3) Some comment lines to make it clear what each section of code does.

(4) The language you are coding in.

(5) A list of the variables, stating whether each is an integer, decimal, string etc.

(6) A clear statement of what output you were expecting and the output you are getting.

Probably more but that will do for starters.

If I was your teacher, I'd know what the exercise was and I'd be able to question you about what you have submitted. But 119 lines of code without any of the above more or less means, just spend a week trying to figure out what this is and correct it. Eeekkk!

Bob

Children are not defined by school ...........The Fonz

You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei

Sometimes I deliberately make mistakes, just to test you! …………….Bob

Offline

**imcute****Member**- Registered: 2022-09-28
- Posts: 176

Bob wrote:

(1) What you are trying to code in words.Ln function on complex rationals

(2) The algorithm(s) you are using (or a flow diagram, for example).Second grade division method

How much times does 3 go into 12?

12-3=9

9-3=6

6-3=3

3-3=0(0 is less than 3)

4 times

How much "exponents" does 3 go into 81?

81/3=27

27/3=9

9/3=3

3/3=1(1 is less than 3)

4 times

(3) Some comment lines to make it clear what each section of code does.dk how to do that,im not a good commenter(4) The language you are coding in.python

(5) A list of the variables, stating whether each is an integer, decimal, string etc.python is dynamicly typed

(6) A clear statement of what output you were expecting and the output you are getting.

>>>ln(e^2)#==2

1.9999999andsomeotherjunk

>>>ln(e^3)#==3

2.9999999andonepointfivetimesthatjunk

>>>(3-ln(e^3)/(2-ln(e^2))#atleast not just on the spot 1.5 right?errors are random

1.5

Bob

Offline