-
Notifications
You must be signed in to change notification settings - Fork 30
Description
There are many problems in physics where it is convenient to use the constant INF, for example with logical tests such as if ($x === INF) or with the function is_finite($x).
Checking for infinite values directly in the Global variables field, as is currently done, may be helpful for beginner users, but it is a significant and unjustified obstacle in advanced calculations.
In my opinion, simply notifying the user that some values or expressions are infinite would be sufficient — blocking the calculation is a poor design choice.
Here are two examples of calculations that should be possible in the Formulas question:
if ($x > 1e12) {
$x = INF; // Treat as infinite
}
if ($x === INF) {
// Handle infinite case
} else {
// Handle finite case
}
if (!is_finite($x)) {
// Handle infinite case
}The Formulas question must be usable for solving advanced scientific problems. Consequently, the handling of infinity should be completely reconsidered. Unfortunately, it has regressed compared to the earlier versions and should instead be improved, for example by taking inspiration from how PHP handles it.
:-)