Fundamentals > Windchill Search > Search Reference > Search Range for Numbers
Search Range for Numbers
When you perform a Criteria search that includes Real Number and Real Number with Unit values, Windchill allows a certain range when returning search results.
For example, you create the following parts:
Part
Weight
Bearing-987
8.0377
Bearing-x55
8.0383
Bearing-n7v2
8.0388
You perform an advanced search for parts based on their weight. You supply a criteria value of 8.038:
Windchill applies a rounding range to searches. As a result, the search would return weights with a range of 8.0375 to 8.0385:
Part
Weight
Returned?
Bearing-987
8.0377
Yes
Bearing-x55
8.0383
Yes
Bearing-n7v2
8.0388
No
The basic rules for rounding ranges is that the range includes numbers that, when rounded, equal the search value input. In the example above, 8.0388 rounds to 8.039, therefore disqualifying it from the search results.
* 
If your display unit is set to a different unit than the base unit (for example, if you have length displayed as inches but Windchill stores the length in centimeters), ranges are applied using the base unit. This can affect which results you see. For more information, see Search Range and Base Unit Conversion.
Rounding
As another example, you perform a search for objects that have a certain attribute value. When performing the search, you enter 1.74 as your attribute value search criteria:
Object attribute value
Included in results?
Explanation
1.7408
Yes
1.740 rounds to 1.74.
1.73611
Yes
1.736 rounds to 1.74.
1.7308
No
1.730 rounds to 1.73.
1.74611
No
1.746 rounds to 1.75.
1.73
No
Numbers that are eligible must be within a roundable range from your initial search value. This extends roughly 0.5 greater than or less than the least significant digit (the last number in your search value).
For example, if you input 1.74, your results will include all values that, when rounded, fall into the range of 1.735 to 1.745.
If you input 1.740, your results will include all values that, when rounded, fall into the range of 1.7395 to 1.7405.
To return 1.73 and 1.74 within the same search, you would need to enter 1.7 as your search criteria. This search would include results that, when rounded, fall into the range of 1.65 to 1.75.
* 
The rounding range only applies to one more digit beyond the least significant digit in the search input. Therefore, if you search for 1.4, an object with a value of 1.3489 is not returned even though it ultimately rounds to 1.4.
Given a search input of 1.4, Windchill only evaluates up to E-2. In this case, 1.3489 is treated as 1.34, which rounds to 1.3 (which is not a match). However, if you search for 1.35, then 1.3489 is rounded from E-3 (1.348), which rounds to 1.35 is a match.
The way that rounding ranges are applied means that you can search for very precise numbers without using many digits in your search term. For example, 1.28378 rounds to:
1.2838
1.284
1.28
1.3
Therefore, if you wish to search for an object that has an attribute value of 1.28378, you can input any of the numbers listed above.
* 
The exception is when your search term is an integer. If you are searching for an integer, an extremely limited range is applied. The range adds and subtracts 5E-14.
For example, a search for 16 would return results from 15.99999999999995 to 16.00000000000005.
Rounding from 5
The key to how Windchill calculates number ranges is how the number 5 is processed. In typical usage, numbers round up from 5. Therefore, 85 rounds to 90, and 11.5 rounds to 12, and so on.
However, Windchill applies the following rule when rounding from 5: When the least significant digit is 5, whether you round up or down depends on the preceding digit.
If the preceding digit is even, then you round down:
4.125 rounds to 4.12
4.145 rounds to 4.14
4.165 rounds to 4.16
If the preceding digit is odd, then you round up:
4.115 rounds to 4.12
4.135 rounds to 4.14
4.155 rounds to 4.16
As a result, when you are rounding from 5, you are always rounding to an even number.
Exclusive vs. Inclusive
Given the following rules:
To be included in the search results, the number must be within a range that, when rounded, equals the search input value.
When rounding from 5, if the preceding digit is even, the number is rounded down
The range of values returned is different depending on whether your search ends on an even or odd digit. The range is either inclusive or exclusive:
When an inclusive range is applied, the range includes the upper and lower boundaries. If the least significant digit is even, the range is inclusive.
For example, given the search input 3.4, the range of values includes all numbers that, when rounded, are greater than or equal to 3.35 and are also less than or equal to 3.45.
When an exclusive range is applied, the range excludes the upper and lower boundaries. If the least significant digit is odd, the range is exclusive.
For example, given the search input 3.3, the range of values includes all numbers that, when rounded, are greater than 3.25 and are also less than 3.35.
Therefore, the range of values returned is slightly larger when your search input ends on an even digit.
Criteria Operators
When you perform an advanced search for numbers, you can use different operators. Ranges are still applied when using the greater than and less than operators.
Whether the initial range is inclusive or exclusive affects your results.
Search Criteria
Result Range
0.48
Because your input value ends in an even number, this is an inclusive range:
Greater than or equal to 0.475
Less than or equal to 0.485
0.48
Less than 0.475.
0.48
Less than or equal to 0.485.
0.48
Greater than 0.485.
0.48
Greater than or equal to 0.475.
Search Criteria
Result Range
2.863
Because your input value ends in an odd number, this is an exclusive range:
Greater than 2.8625
Less than 2.8635
2.863
Less than or equal to 2.8625.
* 
Unlike when you begin with an inclusive range, less than and greater than searches include the upper and lower range boundaries.
This is because in a search for “ 2.863,” Windchill would not return 2.8625.
Therefore, 2.8625 should be returned in a “less than” search.
2.863
Less than 2.8635.
2.863
Greater than or equal to 2.8635.
2.863
Greater than 2.8625.
Isto foi útil?