Предопределённые константы
Перечисленные ниже константы всегда доступны как часть ядра PHP.
| Константа | Значение | Описание | Доступна с версии |
|---|---|---|---|
| M_PI | 3.14159265358979323846 | число Пи | |
| M_E | 2.7182818284590452354 | число Эйлера (e) | |
| M_LOG2E | 1.4426950408889634074 | log_2 e | |
| M_LOG10E | 0.43429448190325182765 | lg e | |
| M_LN2 | 0.69314718055994530942 | ln 2 | |
| M_LN10 | 2.30258509299404568402 | ln 10 | |
| M_PI_2 | 1.57079632679489661923 | Пи/2 | |
| M_PI_4 | 0.78539816339744830962 | Пи/4 | |
| M_1_PI | 0.31830988618379067154 | 1/Пи | |
| M_2_PI | 0.63661977236758134308 | 2/Пи | |
| M_SQRTPI | 1.77245385090551602729 | sqrt(Пи) | PHP 5.2.0 |
| M_2_SQRTPI | 1.12837916709551257390 | 2/sqrt(Пи) | |
| M_SQRT2 | 1.41421356237309504880 | sqrt(2) | |
| M_SQRT3 | 1.73205080756887729352 | sqrt(3) | |
| M_SQRT1_2 | 0.70710678118654752440 | 1/sqrt(2) | |
| M_LNPI | 1.14472988584940017414 | Натуральный логарифм числа пи | |
| M_EULER | 0.57721566490153286061 | Постоянная Эйлера | |
| PHP_ROUND_HALF_UP | 1 | Округление к большему целому | |
| PHP_ROUND_HALF_DOWN | 2 | Округление к меньшему целому | |
| PHP_ROUND_HALF_EVEN | 3 | Округление к чётному числу | |
| PHP_ROUND_HALF_ODD | 4 | Округление к нечётному числу | |
| NAN | NAN (тип float) | Не является числом (Not A Number) | |
| INF | INF (тип float) | Бесконечность |
User Contributed Notes 7 notes
I just learnt of INF today and found out that it can be used in comparisons:
echo 5000 < INF ? ‘yes’ : ‘no’; // outputs ‘yes’
echo INF < INF ? ‘yes’ : ‘no’; // outputs ‘no’
echo INF <= INF ? ‘yes’ : ‘no’; // outputs ‘yes’
echo INF == INF ? ‘yes’ : ‘no’; // outputs ‘yes’
You can also take its negative:
echo -INF < -5000 ? ‘yes’ : ‘no’; // outputs ‘yes’
Division by INF is allowed:
echo 1/INF; // outputs ‘0’
Although INF can be used for comparison against normal numbers and as a directed number, and behaves as reciprocal of zero, it is not like limit INF tends to infinity. These operations do not work:
<?php
var_dump ( INF / INF ); // float(NAN)
var_dump ( INF — INF ); // float(NAN)
?>
However, it works with arc-tangent:
<?php
var_dump ( atan ( INF ) / M_PI ); // float(0.5)
var_dump ( atan2 ( INF , INF ) / M_PI ); // float(0.25)
var_dump ( atan2 ( 1 , INF ) / M_PI ); // float(0)
?>
How to Convert a String to a Number in PHP
PHP is a weakly typed language. This means that when initializing a variable in PHP, one doesn’t need to declare the variable type. PHP implicitly declares a data type for your variable. This can save you from prospective type errors in your code.
When working with programming languages, it is quite common to want to do things with numbers that are represented as strings. For example, performing arithmetic operations, responding to a client request, feeding the data to a database etc. Even though PHP helps with implicit type conversion in some cases, it is important to know about appropriate methods that can facilitate type conversion.
In this guide, we’ll explore the different ways to convert a string to a number in PHP.
Use the links below to skip ahead in the tutorial:
Background: Types of PHP Numbers
Numbers in PHP can take four forms:
- Integers
- Floats
- Infinity
- NaN
Here, integers and floats represent the more commonly used number formats in programming languages, and in everyday life. On the other hand, Infinity and NaN are not as well-defined and are more likely to be encountered in edge-cases. Let us look at these in some more depth.
Integers
Integers are the numbers that do not contain a decimal component. They constitute the set Z=<. -3,-2,-1,0,1,2,3..>. If you initialise a variable in PHP as a number that does not have a decimal component, it takes the integer data type (unless it has a value greater than PHP_INT_MAX).
You can verify if a variable is an integer by using the is_int() function, as shown below.
Float numbers are those that contain a decimal component or are represented in an exponential form. These numbers encompass a higher range of numbers, take up more bytes per number, and are precise up to 14 decimal places. Here are some examples of float numbers —
0.08, 2.39, 132.5, 2.0, 1.3e5, 2e10, etc.
It is important to note that arithmetic operations performed between a float number and an integer always return a float number (even if the returned number does not need a decimal part). For example —
You can verify if a variable is a float number by using the is_float() function, as shown below.
PHP INF (Infinity)
‘INF’ in PHP stands for infinity. In programming languages, it is commonly used to represent any number that is greater than the maximum possible float value (which is platform-dependent in PHP).
INF is usually encountered any time you happen to divide an integer or float number by zero.
INF can also be in the negative form, which can be encountered when you perform an operation like log(0) .
You can verify if a variable is INF by using the is_infinite() or is_finite() function as shown below.
PHP NaN
NaN stands for ‘Not a Number’. It represents outputs of mathematical operations that can not be defined. For example, the arc cosine of x, i.e. acos(x) is undefined for x > 1 and x < 1.
You can verify if a variable is NaN by using the is_nan() function as shown below.
Convert a String to a Number Using Type Casting
To convert a PHP string to a number, we can perform type casting using (int) or (float) keywords as shown below.
Similarly, we can also cast PHP strings to float values using (float) .
Using (int) , we can also convert PHP strings that represent float numbers (eg. “1.78”, “18.19”) directly to integers. This operation floors the float number (eg. “18.19”) down to it’s nearest integer (18). For example —
Convert a String to a Number Using intval()
To convert a PHP string to a number, we can also use the intval() or floatval() function. Below are a few examples of intval() ’s usage.
intval() can also be used to convert strings from hexadecimal (base 16) and octal (base 8) number systems to integers of decimal representations (base 10). The intval() function can also use a second parameter that specifies the base for conversion. The default base value is 10 (for decimal representations).
Apart from string to integer conversion, intval() can also be used to convert strings of float numbers to integers.
Similarly, we can use floatval() to convert to float numbers.
Convert a String to a Number Implicitly using Mathematical Operations
If you have a number that is initialized as a string in your code, PHP allows you to perform arithmetic operations directly on that string variable. This means that PHP implicitly performs the type conversion so that your code doesn’t raise an error. These are seemingly some of the advantages of weakly (or loosely) typed languages like PHP.
Let’s see how we can leverage this implicit type conversion to our advantage.
As can be seen above, even though we started with a string variable, a trivial arithmetic operation has implicitly converted it to an integer.
Agreed, this is not the most elegant approach to convert a string to a number, but in many cases, it can still save you from an explicit type conversion.
Formatting Number Strings Using number_format()
Before we close, I’d like to shed some light on how we can format number strings (numbers stored as strings) to improve presentation.
Some posts on the internet incorrectly claim that number_format() function can be used to convert a string to a number. This is not true.
The number_format() function can be used to format numbers that are stored in the form of strings — by adding commas to separate between thousands and/or specifying the number of decimal places. The function always returns a formatted string (not a number variable) and can be used as shown below —
number_format(string_number, n_decimal_places , decimal_point_symbol, separator_symbol)
All arguments here, except the first one ( string_number ) are optional.
Let’s look at a few examples.
Test it for Yourself
In this post, we looked at different types of numbers in PHP — integers, float numbers, INF (infinity), and NaN. We also looked at how we can convert PHP strings into numbers using various methods — by typecasting, using intval() and floatval() methods, and also by implicit conversion using mathematical operations. We also looked at how we can use the number_format() function to format number strings to improve presentation.
Now that you know about numbers in PHP, about how to convert strings to numbers and about number string formatting, go ahead and try it out. Choose whichever conversion method suits you best and implement what you learned in this post.
Inf php что это
Здесь могла бы быть ваша реклама
Покинул форум
Сообщений всего: 4574
Дата рег-ции: Июль 2006
Откуда: Israel
Помог: 3 раз(а)
Секрет
Теперь, когда вы уже наверняка второпях отправили свой запрос,
я расскажу вам простой секрет, который сэкономит вам уйму ожиданий,
даже если первый ответ по теме последуем сразу же.
Само собой я знаю что ответят мне тут же, и если я посмотрю
на сообщения на форуме, то пойму что в общем то я и не ошибаюсь.
Но еще я точно замечу, что очень мало тем, в которых всего два ответа :
вопрос автора и еще два сообщение вида Ответ + Спасибо
После этого приходится начинать уточнять этим неграмотным что мне надо.
Они что, сами читать не умеют? А уточнять приходится.
И иногда пока они переварят то что я им скажу проходит и не одна ночь..
Уверен что если бы я им сказал что у меня есть
фиолетовый квадрат, и нужно превратить его в синий треугольник
и я пытался взять кисточку, макнуть в банку и поводить ей по квадрату
но почему то кисточка не принимала цвет краски в банке,
то на мой вопрос — где взять правильные банки мне бы ответили гораздо быстрее
предложив её открыть, а не тратить еще стольник на жестянку.
Поэтому с тех пор я строю свои вопросы по проверенной давным давно схеме:
Что есть
Что нужно получить
Как я пытался
Почему или что у меня не получилось.
На последок как оно происходит на форумах
Новичок: Подскажите пожалуста самый крепкий сорт дерева! Весь инет перерыл, поиском пользовался!
Старожил: Объясни, зачем тебе понадобилось дерево? Сейчас оно в строительстве практически не используется.
Новичок: Я небоскрёб собираюсь строить. Хочу узнать, из какого дерева делать перекрытия между этажами!
Старожил: Какое дерево? Ты вообще соображаешь, что говоришь?
Новичок: Чем мне нравиться этот форум — из двух ответов ниодного конкретного. Одни вопросы неподелу!
Старожил: Не нравится — тебя здесь никто не держит. Но если ты не соображаешь, что из дерева небоскрёбы не строят, то лучше бы тебе сначала школу закончить.
Новичок: Не знаите — лучше молчите! У меня дедушка в деревянном доме живёт! У НЕГО НИЧЕГО НЕ ЛОМАЕТСЯ.
Но у него дом из сосны, а я понимаю, что для небоскрёба нужно дерево прочнее! Поэтому и спрашиваю. А от вас нормального ответа недождёшся.
Прохожий: Самое крепкое дерево — дуб. Вот тебе технология вымачивания дуба в солёной воде, она придаёт дубу особую прочность:
Новичок: Спасибо, братан! То что нужно.
Отредактировано модератором: Uchkuma, 26 Апреля, 2011 — 10:21:12
PHP Numbers Basics
In the PHP Foundation unit, we covered a lot about PHP including some of the very basic aspects of working with numbers. We saw the two types of numbers in the language i.e. integers and floats, in addition to ideas related to each of these types.
In this chapter, we aim to take all that knowledge one step further and digest even more ideas in the world of numbers in PHP. In particular, here we’ll learn about how are integers and floats represented internally in memory, how to work with the special float values INF and NAN , and a lot more number-related functions such as intval() , floatval() , intdiv() and so on.
We’ll also explore the scientific notation used to denote a float in PHP in addition to the recently-added underscore symbol to improve the readability of long integers.
In short, this chapter will take us way ahead in fluency while working with numbers in PHP, which is a must-to-have skill for every single computer programmer.
A quick recap
Let’s start with a quick recap of what we already know about numbers in PHP.
There are two kinds of numbers in PHP — integers and floats. The distinction between these is fairly easy to understand — one doesn’t have a fractional part whereas the other does.
A numeric literal that doesn’t have a decimal point ( . ) in it is considered to be an integer. However, a literal with a decimal point is considered a float.
Some examples of integers are -1000 , -29 , 0 , 2 and 50000 while some examples of floats are -102.3 , -2.323423 , 0.0 , 2.0000023 and -234234.99090 .
To convert a given value to an integer, we can use the (int) typecast as shown below:
Similarly, to convert a given value to a float, we can use the (float) typecast, as shown below:
Both integers and floats support all of the most common arithmetic operations such as addition, subtraction, multiplication, division, exponentiation, and modulo.
Finally, to check whether a given value is an integer, we use the is_int() function and similarly to check if the value is a float, we use the is_float() function.
In the snippet below, we perform the is_int() check on a handful of values:
And in the snippet below, we perform the is_float() check on the same values:
And this is it for the recap.
Internal representation of integers
PHP is a sufficiently high-level language that only provides one single type for an integer unlike languages such as C, C++ where we have a multitude of types to represent an integer each having a different range.
An integer in PHP consumes 4 bytes of memory on a 32-bit machine whereas 8 bytes on a 64-bit machine. Moreover, all integers in PHP are signed. The format used internally is the typical format used across all modern languages to implement integers i.e. 2’s complement.
Here’s how an integer in PHP would look in memory:

The leftmost bit denotes the sign of the integer, together with a bias. Each bit has a power of 2 associated with it as mentioned above. The final integer is determined by adding all these powers wherever the bit is 1 .
Hence, 37 is represented as follows:

Similarly, -128 is represented as follows, keeping in mind that the leftmost 1 bit doesn’t just represent the — sign but rather a value of -9223372036854775808 which has to be added with a positive value to make the end result -128 .

Consequently, under this format, the minimum and maximum integers on a 32-bit machine are -2147483648 and 2147483647 respectively, while -9223372036854775808 and 9223372036854775807 on a 64-bit machine, respectively.
The constants PHP_INT_MIN and PHP_INT_MAX hold the minimum and maximum integers on the current machine:
Our machine is 64-bit, hence we get the following:
So this is a little glimpse into the internals of integers in PHP.
Frankly speaking, we don’t need to know about this representation as far as working in the language is concerned. It’s just an internal detail that’s helpful and useful as side knowledge.
Internal representation of floats
Floats in PHP are based on the IEEE-754 double-precision floating-point format. This is a fairly standard format used across almost all the mainstream languages to denote floating-point numbers.
In this format, each float consumes 8 bytes of memory. These 8 bytes, or 64 bits, are segmented into three groups, each denoting a certain aspect of the float. Before we can make sense of this segmentation, we ought to understand scientific notation.
Scientific notation, also known as standard form, or exponential notation, is a standard way to represent very small or very large numbers nearly in mathematics, physics, chemistry, biology and other scientific disciplines.
It is comprised of three parts — a sign, followed by a significand, followed by a power of 10.
The significand is typically written with one digit before the decimal point (if there is a decimal point). The base of the power is usually ::10:: in our calculations.
So far example, ::105.6:: can be expressed as ::1.056 \times 10^2. Similarly, ::-30.37:: would be expressed as ::-3.037 \times 10^1:: in scientific notation.
This is scientific notation in the decimal number system. In the realms of computers, however, we need a binary system. Fortunately, it’s also very easy to devise a binary system for scientific notation. Instead of raising ::10:: to the given exponent, we raise the integer ::2. Moreover, each digit in the significand represents a power of ::2. not a multiple of a power of ::10.
Hence, ::2.5:: would be represented as ::10.1 \times 2^0:: (i.e ::2 + 0.5::) in binary scientific notation. Similarly, ::-50.25:: would be represented as ::-1.1001001 \times 2^5:: (i.e. the number ::-110010.01:: after multiplying with the power ::2^5::).
IEEE-754 uses this scientific notation to represent floats in memory. Each number is broken down into three segments — a sign, an exponent of ::2. and a significand.
The sign is alloted 1 bit (the leftmost bit), the exponent is alloted the next 11 bits, and the last 52 bits are alloted to the significand. Now these are just part of the details of the format. If we dig a little more deeper, there are many many other things to consider such the representation of the special numbers INF and NAN , exponent bias, extra digit appended to the significand, and much more.
At least at this stage, we don’t need all this in-depth information. Just a little knowledge would be more than enough in appreciating the level of mathematics that goes into building numeric systems on computing machines.
Anyways, moving on, the maximum number possible in this format is approximately ::1.8 \times 10^<308>:: while the minimum is ::-1.8 \times 10^<308>.
The maximum float can be retrieved via the constant PHP_FLOAT_MAX , whereas the minimum can be retrieved by simply negating PHP_FLOAT_MAX , as shown below:
In addition to this, the most precise number is somewhere close to ::4.9 \times 10^<324>.
And this is it for the internals of floating-point numbers in PHP.
Using underscores ( _ ) in literals
Since PHP 7.4.0, underscores (_) have been added to the language in order to separate digits from one another in a numeric literal.
When parsing code, these underscores are removed before the next stage by the underlying engine, so they are just a syntactic sugar in the language.
Let’s see a quick example. Suppose we want to denote the number ::1\,000\,560\,356:: in PHP.
In the code below, we represent this number in two ways — one without underscores and one with them:
Which one seems more readable? Clearly the second one.
As stated before, these underscores are removed when parsing the code. This can be confirmed by outputting the integers:
As can be seen, both the output numbers are exactly equal to one another.
Moving on, note that when using underscores, make sure to not leave any underscores at either end of the numeric literal. Both can lead to an error. Even adding two underscores next to each other is a syntax error.
For instance, in the code below, we get a semantic error thrown because of _ at the start of 1_000 :
PHP interprets _1_000 as a constant as it begins with an underscore ( _ ). And since it can’t find such a constant, it throws an error.
Similarly, in the code below, adding two underscores after one another leads to a syntax error:
The E notation
In the discussion above regarding the internal representation of floats in PHP, we learnt about the scientific notation.
Directly representing floats in this way in PHP, and nearly all popular languages, is possible via the E notation.
Note that E could also be written as e i.e. it’s case-insensitive.
The general syntax of E is as follows:
<number> is the number to multiply with a power of 10 , whereas <exponent> is the number to which 10 is raised. The <exponent> could have a sign ( + or — ) as well.
This is equivalent to <number> x 10 <exponent> in other words.
Let’s see how to use E to represent 156.2 in PHP:
The significand here is 1.562 , while the exponent is +2 .
Let’s try using a negative exponent:
As we can see in both the output snippets above, PHP expands the exponential notation by multiplying the given significand with the given power and then printing the resulting number.
However, this only holds upto a limit beyond which PHP simply outputs the number in E notation.
An example follows:
Here the number 18.3E+300 is extremely large for PHP to expand when printing. Hence, it falls back with printing the number in exponential notation.
Also notice how PHP automatically normalizes the significand by shifting the decimal point by one position to the left (i.e. 1.83E+301 instead of 18.3E+300 ) to resemble the typical scientific notation in mathematics.
Special numbers
Following from the IEEE-754 format that PHP uses to represent floats internally, there are two special floating-point numbers in the language — INF and NAN .
Both these numbers are available as global constants.
Let’s explore them one-by-one.
We’ll start with INF .
Creating a float that’s larger than the maximum value ≈ 1.8 x 10 308 or lesser than the minimum value ≈ -1.8 x 10 308 results in INF and -INF , respectively.
Shown below are two examples for INF :
Both the numbers 2E+500 and 1.8E+308 are above the maximum value capable of being stored in PHP, and likewise boil down to INF .
Similarly, below we have two examples for -INF :
-2E+500 and -1.8E+308 are below the minimum value capable of being stored in PHP, and so boil down to -INF .
Even adding two INF values leads to INF .
This is a sensible result since adding two infinite values can never give a finite result!
Apart from INF , NAN is another special kind of a number.
The most typical operation giving NAN in the end is the subtraction of INF with INF . As can be reasoned, this operation can’t really be defined numerically, hence NAN is used to represent the result:
One of the most surprising things regarding NAN is that two NAN values aren’t considered equal to one another:
This isn’t a rule specific to PHP — the IEEE-754 specification defines this behavior itself.
Now there are multiple reasons for choosing this behavior as defined in the spec, but at least for us, we don’t need to worry a lot about the exact reasons. We should, at most, know about this behavior and how to actually test whether a given number is NAN .
The function is_nan() can be used to determine whether a given value is NAN .
$value is the value to test against NAN . If it’s NAN , the function returns true , or else false .
Consider the code below:
NAN and INF — INF both are NAN values, hence the first two is_nan() calls yield true . However, 0 and INF + INF (which gives INF ) are both non- NAN values and likewise is_nan() yields false in the last two calls.
Integer division
Most statically-typed languages provide different semantics for the division operation when performed on two integers. That is, the result is also an integer rather than a float which can otherwise hold on to the fraction in the result.
Such a kind of division is generally known as integer division.
In PHP, as we know, the division operator ( / ) does NOT work this way. That is, if the result of a division of two integers is a float, then the operation returns a float.
An illustration follows:
We know that 3 divided by 2 gives 1.5 , and that’s exactly what’s stored in $num here.
Thus, to restate it, division in PHP via / on two integers is not integer division.
However, if we want such a kind of division, it’s very very simple — just cast the resulting number to an integer.
Consider the following:
As can be seen, (int) (3 / 2) yields 1 . The 1.5 returned by (3 / 2) is casted to an integer by (int) resulting in the fraction .5 being thrown away from 1.5 .
Another way to perform this same operation is to use the intdiv() function.
As with the normal division via / , intdiv() takes two values in the same order as in a normal division, and then returns the result of performing integer division over the two numbers.
Below shown is the same example as before, this time using intdiv() :
Type conversion functions
We’ve already seen the (int) and (float) casts from the previous part of this course — they both don’t need an introduction.
What’s interesting to know is that PHP also provides two functions that do the exact same thing with exactly the same semantics i.e. intval() and floatval() , respectively.
Both of the functions require just a single argument which is the value to coerce.
Here’s an example:
Now since both these functions operate exactly like the typecasts (int) and (float) , you might have one question in you mind right now.
Type conversion functions vs. typecasts in PHP
So what really is the difference between (int) and intval() and similarly between (float) and floatval() in PHP?
What exactly is the point of providing two ways to perform the exact same operation?
Well, this is a really good question with a really simple answer.
Both intval() and floatval() are functions and hence could be passed to another function to convert given values to integers or floats, respectively. This doesn’t hold for the casts (int) and float() i.e. they can NOT be passed in to functions.
A very good example of a case where we might want to pass intval() or floatval() to another function is when using array_map() .
We’ll cover the details of array_map() later in the PHP Arrays unit, but to discuss it briefly, it allows us to map an array to another array based on a mapping function.
For instance, we could map the array [1, 2, 3, 4] to [1, 4, 9, 16] using a function that returns the square of a given number. Similarly, we could map [‘1’, ‘2’, ‘3’, ‘4’] to [1, 2, 3, 4] using the intval() function.
This aint’ possible using (int) .
Checking if a float is an integer
Although it’s not a highly common operation, at some point while working with floats, we might want to determine if it has a fractional part of zero.
For instance, 10.2 fails this check since it has a non-zero fractional part of .2 . However, 10.0 meets it since it has a zero fractional part i.e .0 .
The question is how to perform this check?
Well PHP doesn’t provide a native function or construct to do so. However, it’s completely possible to accomplish this operation using the existing features we know from PHP.
Let’s see if you can come up with it.
Time to tacke this problem.
To determine if a float has a fractional part of zero, we can perform the following steps:
- First, cast the float to an integer.
- Then, cast the integer back to a float.
- Finally, compare the result to the original float using === . If the comparison passes, the float is an integral number.
The reason why this approach works is because when a float in an integral number, i.e. has a fractional part of zero, casting to an integer (which throws off the fractional part) would cause no precision loss in the float and then casting back this integer to a float would restore the original value.
Thus, both the initial and final values would be identical to one another.
Let’s try and test this:
Note that instead of casting the resulting integer with (float) and then comparing $f with the casted value using the identity operator ( === ), we can use the equality operator ( == ).
Behind the scenes, == does the same thing as we’re manually trying to do over here i.e. when one operand is a float and the other is an integer, the integer is automatically casted to a float before performing the comparison.
The following code is the same as before, just this time we use == instead of the identity operator ( === ) and skip the explicit (float) cast:
The result is, and will always be, exactly the same.
Simple, wasn’t this?
Limitations of this approach
When using this or possibly other approaches to check whether a given float actually represents an integral number, we should be aware of certain limitations.
For instance, consider the number 5E+300 . We know that it’s an integral number with many many zeroes. However, the same approach as before doesn’t recognize it as such:
The thing is that when a floating-point number is cast to an integer in PHP, if the float is larger than PHP_INT_MAX , then it’s cast to the value PHP_INT_MIN . Then, when this PHP_INT_MIN value is cast back to a float, once again some precision is lost in the casting.
In the end, the original float is not at all equal to the double-casted float and hence PHP doesn’t recognize it as an integral number.
Long story short, this idea of determining whether a float represents an integral number is only defined upto a certain limit.
Beyond that limit, only undefined behavior occurs due to the casting of extremely large or extremely small numbers back and forth from the integer and float types that result in a loss of precision and, sometimes, of the original values.