7 ms·
good question. but if you look at the "magic" concept from a higher level then you'll find that this function of course is based on magic numbers as it itself i
by 2-718-281-828 4y ago
good question. but if you look at the "magic" concept from a higher level then you'll find that this function of course is based on magic numbers as it itself is a _magic function_. it doesn't solve generally equations but specifically _quadratic_ equations. a more extreme and obvious example in the same vain would be:
def print_every_second_for_a_minute():
...
having said that - there are always exceptions.
- xigoi 4y agoHow would you define a “magic function”? Solving equations in general is not possible, so if you're trying to say that this function is too specific, good luck generalizing it.
- 2-718-281-828 4y agoI talk about magic numbers from an abstract, theoretical perspective. from that perspective it's not relevant that you can't generalize an equation solver. but would bet that if it was possible then there would be no numbers except for 0 and 1. --- you could also think of it this way. a generalized equation solver would necessarily derive the solution in a complete fashion. for someone analyzing the code it would be come clear what's going on. your specialized equation solver otoh just has some "magical" solution in there.