Enable or disable extreme numbers
The CalculationLaboratory library has a thing called enable_extnumber(x).e>. It seems like a simple function, but if you work with calculations even a little deeper than school mathematics, it can seriously help you out.
The meaning is this:
x = 0 — we live the old-fashioned way, everything works with ordinary numbers;
x = 1 — we activate calculations with so-called "extreme" numbers. They are also ultra—high precision numbers. It's like a microscope for numbers.
To make it clear: if a fraction is involved in the expression, the function does not touch it. But if a regular number and an extreme number meet, the result will be extreme (if the function is enabled, of course). That is, as programmers say, it works like a "magnet" — it pulls everything to high accuracy.
Why all this? Well, here's a simple test. If you get enough results, "plus or minus within reason," you don't have to worry. But if your calculations go beyond hundreds of decimal places (hello, physicists, astronomers and other fans of ultra—precise models), ordinary arithmetic gives up. But not here.
Turned on, you calculate with precision up to an absurd number of characters (or, if you want, up to the meaning of life). Turned it off, and you're living in the world of ordinary mathematics again, where? it is rounded up to at least three digits, at least to fifteen.
In fact, it's not even so much about the "function" as about the opportunity. And it's important to keep it in mind, especially if you're developing mathematical models, running formulas over the entire range of values, or just don't want to lose important signs at the end of a lengthy calculation. Everything works, but now you decide when to turn on turbo mode.
Yes, it sounds like a toy for geniuses. But it is precisely these "little toggle switches" in the code that often turn a working script into a serious tool. So be aware of this. And, on occasion, don't hesitate to turn on extreme precision. You never know — it will come in handy.
Help on built-in functions
The rules of programming scripts
Programm options
Color constants