168 references to Abs
dotnet-svcutil-lib (2)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlConverter.cs (2)
1113offset += ToCharsD2(Math.Abs(ts.Hours), chars, offset); 1115offset += ToCharsD2(Math.Abs(ts.Minutes), chars, offset);
Metrics (1)
src\RoslynAnalyzers\Utilities\Compiler\SmallDictionary.cs (1)
303Math.Abs(a - b) >= 2)
Metrics.Legacy (1)
src\RoslynAnalyzers\Utilities\Compiler\SmallDictionary.cs (1)
303Math.Abs(a - b) >= 2)
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
src\Grpc\JsonTranscoding\src\Shared\Legacy.cs (1)
229AppendNanoseconds(builder, Math.Abs(nanos));
Microsoft.AspNetCore.Grpc.Swagger (1)
src\Grpc\JsonTranscoding\src\Shared\Legacy.cs (1)
229AppendNanoseconds(builder, Math.Abs(nanos));
Microsoft.AspNetCore.OpenApi.SourceGenerators (2)
Helpers\ISymbolExtensions.cs (2)
156if (bestMethod is null || Math.Abs(method.Parameters.Length - parameterCount) < Math.Abs(bestMethod.Parameters.Length - parameterCount))
Microsoft.CodeAnalysis (1)
Collections\SmallDictionary.cs (1)
191Math.Abs(a - b) >= 2)
Microsoft.CodeAnalysis.Analyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\SmallDictionary.cs (1)
303Math.Abs(a - b) >= 2)
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\RoslynAnalyzers\Utilities\Compiler\SmallDictionary.cs (1)
303Math.Abs(a - b) >= 2)
Microsoft.CodeAnalysis.BannedApiAnalyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\SmallDictionary.cs (1)
303Math.Abs(a - b) >= 2)
Microsoft.CodeAnalysis.CodeStyle (3)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (2)
127if (bestMethod is null || Math.Abs(method.Parameters.Length - parameterCount) < Math.Abs(bestMethod.Parameters.Length - parameterCount))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\WordSimilarityChecker.cs (1)
142var lengthDifference = Math.Abs(originalText.Length - candidateText.Length);
Microsoft.CodeAnalysis.CSharp (4)
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.ValueDispatchNode.cs (3)
109Debug.Assert(Math.Abs(l - r) <= 1); 162Debug.Assert(Math.Abs(left.Height - right.Height) <= 2); 251Debug.Assert(Math.Abs(left.Height - right.Height) < 2);
Utilities\ValueSetFactory.IntTC.cs (1)
75return Math.Abs((random.Next() << 10) ^ random.Next());
Microsoft.CodeAnalysis.Features (1)
RelatedDocuments\AbstractRelatedDocumentsService.cs (1)
97IteratePotentialTypeNodes(root).OrderBy(t => Math.Abs(t.expression.SpanStart - position)),
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Features\UnifiedSuggestions\UnifiedSuggestedActionSetComparer.cs (2)
46var startsDistance = Math.Abs(a.Start - b.Start); 47var endsDistance = Math.Abs(a.End - b.End);
Microsoft.CodeAnalysis.PublicApiAnalyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\SmallDictionary.cs (1)
303Math.Abs(a - b) >= 2)
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\RoslynAnalyzers\Utilities\Compiler\SmallDictionary.cs (1)
303Math.Abs(a - b) >= 2)
Microsoft.CodeAnalysis.UnitTests (10)
Collections\EnumerableExtensionsTests.cs (2)
48public bool Equals(int x, int y) => Math.Abs(x) == Math.Abs(y);
Collections\HashSet\TestingTypes.cs (5)
158return Math.Abs(x) - Math.Abs(y); 163return Math.Abs(x) == Math.Abs(y); 168return Math.Abs(x);
Collections\ImmutableArrayExtensionsTests.cs (3)
130return Math.Abs(x) == Math.Abs(y); 135return Math.Abs(x);
Microsoft.CodeAnalysis.Workspaces (4)
Shared\Utilities\BloomFilter.cs (1)
331return Math.Abs(hash);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (2)
127if (bestMethod is null || Math.Abs(method.Parameters.Length - parameterCount) < Math.Abs(bestMethod.Parameters.Length - parameterCount))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\WordSimilarityChecker.cs (1)
142var lengthDifference = Math.Abs(originalText.Length - candidateText.Length);
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Parser.cs (1)
921return ret == int.MinValue ? 0 : Math.Abs(ret); // Ensure the result is non-negative
Microsoft.Gen.Logging (1)
Emission\Emitter.Method.cs (1)
160return ret == int.MinValue ? 0 : Math.Abs(ret); // Ensure the result is non-negative
Microsoft.Maui.Controls.BindingSourceGen (1)
BindingSourceGenerator.cs (1)
47 var code = BindingCodeWriter.GenerateBinding(binding, (uint)Math.Abs(location.GetHashCode()));
Microsoft.ML.Core (1)
Utilities\Stats.cs (1)
371int km = Math.Abs(k - m);
Microsoft.ML.TorchSharp (2)
AutoFormerV2\Attention.cs (2)
80var offset = new Tuple<int, int>(Math.Abs(points[i][0] - points[j][0]), Math.Abs(points[i][1] - points[j][1]));
Microsoft.ML.Transforms (1)
Expression\BuiltinFunctions.cs (1)
163FunctionProviderUtils.Fn<I4, I4>(Math.Abs),
PresentationCore (9)
MS\Internal\AnimatedTypeHelpers.cs (3)
370return Math.Abs((Int32)to - (Int32)from); 408return Math.Abs(to - from); 413return Math.Abs(to - from);
MS\Internal\Ink\InkSerializedFormat\SerializationHelper.cs (1)
105ull = (ulong)Math.Abs(Value);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Ink\BitStream.cs (1)
279int rightShiftNextByteBy = Math.Abs((countOfBits - _cbitsInPartialByte) - Native.BitsPerByte);
System\Windows\Input\Stylus\Pointer\PointerLogic.cs (1)
1276int elapsedTime = Math.Abs(unchecked(stylusDownEventArgs.Timestamp - _lastTapTimeTicks));
System\Windows\Input\Stylus\Wisp\PenContexts.cs (1)
186if (context.QueuedInRangeCount > 0 || (Math.Abs(unchecked(timestamp - context.LastInRangeTime)) <= 500))
System\Windows\Input\Stylus\Wisp\WispLogic.cs (2)
1089int timeSpan = Math.Abs(unchecked(stylusDownEventArgs.Timestamp - stylusDevice.LastTapTime)); 3264if (Math.Abs(unchecked(timestamp - _lastInRangeTime)) <= 500)
PresentationFramework (28)
MS\Internal\Documents\DocumentGrid.cs (1)
315if (Math.Abs(pageNumber - _firstVisiblePageNumber) > 1)
MS\Internal\Documents\DocumentPageTextView.cs (2)
652while (Math.Abs(pagesMoved) < Math.Abs(count))
MS\Internal\Documents\MultiPageTextView.cs (8)
759Invariant.Assert(Math.Abs(request.NewCount) >= Math.Abs(linesMoved)); 831Invariant.Assert(Math.Abs(request.NewCount) >= Math.Abs(pagesMoved)); 979Invariant.Assert(Math.Abs(pagesMoved) <= Math.Abs(count)); 1192int closestDistance = Math.Abs(count); 1217int distance = Math.Abs(currentPageNumber - pageNumber);
MS\Internal\PtsHost\TableParaClient.cs (6)
645int du = Math.Min(Math.Abs(rect.u - u), Math.Abs(rect.u + rect.du - u)); 646int dv = Math.Min(Math.Abs(rect.v - v), Math.Abs(rect.v + rect.dv - v)); 994int iDistance = Math.Abs((cpc.Rect.u + cpc.Rect.du / 2) - suggestedU); 1070int iDistance = Math.Abs((cpc.Rect.u + cpc.Rect.du / 2) - suggestedU);
System\Windows\Application.cs (1)
2375if (Math.Abs(diff) == 1)
System\Windows\Controls\DataGrid.cs (4)
5025int newRowCount = Math.Abs(endIndex - startIndex) + 1; 5026int newColumnCount = Math.Abs(endColumnIndex - startColumnIndex) + 1; 5045int previousRowCount = Math.Abs(currentCellIndex - startIndex) + 1; 5047int previousColumnCount = Math.Abs(currentCellColumnIndex - startColumnIndex) + 1;
System\Windows\Controls\ScrollViewer.cs (1)
1841if (Math.Abs(Environment.TickCount - _panningInfo.InertiaBoundaryBeginTimestamp) < PanningInfo.InertiaBoundryMinimumTicks)
System\Windows\Controls\TextRangeAdaptor.cs (1)
992int absCount = (count == int.MinValue) ? int.MaxValue : Math.Abs(count);
System\Windows\Documents\DocumentSequenceTextPointer.cs (1)
1029distance = Math.Abs(distance);
System\Windows\Documents\FlowPosition.cs (1)
310distance = Math.Abs(distance);
System\Windows\Documents\TextRangeEditTables.cs (1)
1429int cCols = Math.Abs(columnCount);
System\Windows\SystemFonts.cs (1)
1017return (double)(Math.Abs(height) * 96 / dpi);
Roslyn.Diagnostics.Analyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\SmallDictionary.cs (1)
303Math.Abs(a - b) >= 2)
System.Data.Common (2)
System\Data\SQLTypes\SQLDecimal.cs (2)
3186int lAdjust = Math.Abs(lPosition - n._bScale); // Precision adjustment 3225lAdjust = Math.Abs(lPosition - n._bScale);
System.Net.Sockets (1)
System\Net\Sockets\SocketAsyncEngine.Unix.cs (1)
117int engineIndex = Math.Abs(Interlocked.Increment(ref s_allocateFromEngine) % s_engines.Length);
System.Private.CoreLib (4)
src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Nls.cs (1)
79realLength = Math.Abs(realLength);
src\libraries\System.Private.CoreLib\src\System\Int32.cs (1)
714public static int Abs(int value) => Math.Abs(value);
src\libraries\System.Private.CoreLib\src\System\Number.NumberToFloatingPointBits.cs (1)
1006int fastExponent = Math.Abs(exponent);
src\libraries\System.Private.CoreLib\src\System\Random.CompatImpl.cs (1)
279int subtraction = (seed == int.MinValue) ? int.MaxValue : Math.Abs(seed);
System.Private.DataContractSerialization (2)
System\Xml\XmlConverter.cs (2)
1071offset += ToCharsD2(Math.Abs(ts.Hours), chars, offset); 1073offset += ToCharsD2(Math.Abs(ts.Minutes), chars, offset);
System.Private.Xml (1)
System\Xml\Xsl\XPathConvert.cs (1)
1042(idx == mantissaSize - 1) && Math.Abs(mantissa[idx] - mantissaPrec[idx]) <= 1
System.Runtime.Caching (2)
System\Runtime\Caching\CacheUsage.cs (2)
28Debug.Assert((Math.Abs(entryIndex) & ENTRY_MASK) == (Math.Abs(entryIndex)), "(Math.Abs(entryIndex) & ENTRY_MASK) == Math.Abs(entryIndex)");
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\Symbolic\RegexNodeConverter.cs (1)
427int cat = Math.Abs((int)categoryCode) - 1;
System.Windows.Forms (36)
System\Windows\Forms\Application.cs (1)
384systemColorMode = Math.Abs((Registry.GetValue(
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (15)
5786if (Math.Abs(dgvcme.X - _lastMouseClickInfo.X) <= hotDoubleClickZone.Width / 2 5787&& Math.Abs(dgvcme.Y - _lastMouseClickInfo.Y) <= hotDoubleClickZone.Height / 2) 9639int absXOffset = Math.Abs(xOffset), normOffset = xOffset / absXOffset; 9656ptMouse.Y - yOffset - (yOffset / Math.Abs(yOffset))) 12700if (Math.Abs(_ptMouseDownGridCoord.X - ptGridCoord.X) >= s_dragSize.Width 12701|| Math.Abs(_ptMouseDownGridCoord.Y - ptGridCoord.Y) >= s_dragSize.Height) 16282HorizScrollTimer.Interval = GetColumnScrollRate(Math.Abs(xOffset)); 16297VertScrollTimer.Interval = GetRowScrollRate(Math.Abs(yOffset)); 16520if (Math.Abs(VerticalOffset - originalVerticalOffset) >= Math.Abs(fullNotches * _vertScrollBar.LargeChange)) 16533if (Math.Abs(HorizontalOffset - originalHorizontalOffset) >= Math.Abs(fullNotches * _horizScrollBar.LargeChange)) 16622absScrollBands = Math.Abs(scrollBands); 29875int absYOffset = Math.Abs(yOffset), normOffset = yOffset / absYOffset; 29891? HitTest(ptMouse.X - xOffset - (xOffset / Math.Abs(xOffset)), ptMouse.Y - yOffset - normOffset)
System\Windows\Forms\Controls\ImageList\ImageList.cs (1)
564int length = Math.Abs(targetData.Stride);
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (1)
1923if (Math.Abs(gridBottom - y) <= 1 && y > gridTop)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (5)
2606if (Math.Abs(screenPoint.X - _rowSelectPos.X) < SystemInformation.DoubleClickSize.Width && 2607Math.Abs(screenPoint.Y - _rowSelectPos.Y) < SystemInformation.DoubleClickSize.Height) 3194if (Math.Abs(initialOffset - originalOffset) >= Math.Abs(fullNotches * _scrollBar.LargeChange)) 5045private bool SplitterInside(int x) => Math.Abs(x - LabelWidth) < 4;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (2)
375else if (!_resizeUp && Math.Abs(Height - y) < s_resizeBorderSize) 379else if (_resizeUp && Math.Abs(y) < s_resizeBorderSize)
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (1)
397if (nextControl is not null && Math.Abs(nextControl.TabIndex - startTabIndex) <= 1)
System\Windows\Forms\Layout\DefaultLayout.cs (8)
305left = Math.Max(Math.Abs(left), Math.Abs(cachedBounds.Left)); 308right = left + Math.Max(element.Bounds.Width, cachedBounds.Width) + Math.Abs(right); 313right = right > 0 ? right : element.Bounds.Right + Math.Abs(right); 323top = Math.Max(Math.Abs(top), Math.Abs(cachedBounds.Top)); 326bottom = top + Math.Max(element.Bounds.Height, cachedBounds.Height) + Math.Abs(bottom); 331bottom = bottom > 0 ? bottom : element.Bounds.Bottom + Math.Abs(bottom);
System\Windows\Forms\Rendering\ControlPaint.cs (1)
2416if (Math.Abs(pixelColorWrapper.Luminosity - backgroundColorWrapper.Luminosity) > MaximumLuminosityDifference)
System\Windows\Forms\Scrolling\ScrollBar.cs (1)
541while (Math.Abs(_wheelDelta) >= PInvoke.WHEEL_DELTA)
System.Windows.Forms.Design (30)
System\Windows\Forms\Design\Behavior\ContainerSelectorBehavior.cs (2)
179Size delta = new(Math.Abs(mouseLoc.X - InitialDragPoint.X), Math.Abs(mouseLoc.Y - InitialDragPoint.Y));
System\Windows\Forms\Design\Behavior\DragAssistanceManager.cs (10)
296if (Math.Abs(delta) < Math.Abs(smallestDelta)) 313if ((Math.Abs(smallestDelta) < Math.Abs(smallestDistance)) || 314((Math.Abs(smallestDelta) == Math.Abs(smallestDistance)) && (pri > highestPriority))) 798if (Math.Abs(distances[i]) < distanceValue) 800distanceValue = Math.Abs(distances[i]); 1126_snapPointX = (Math.Abs(smallestDistanceVert) <= SnapDistance) ? -smallestDistanceVert : INVALID_VALUE; 1127_snapPointY = (Math.Abs(smallestDistanceHorz) <= SnapDistance) ? -smallestDistanceHorz : INVALID_VALUE;
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (3)
442return pixelsMoved - (integralHeight - (Math.Abs(pixelsMoved) % integralHeight)); 492if (Math.Abs(_initialPoint.X - mouseLoc.X) > DesignerUtils.MinDragSize.Width / 2 || Math.Abs(_initialPoint.Y - mouseLoc.Y) > DesignerUtils.MinDragSize.Height / 2)
System\Windows\Forms\Design\ComponentTray.cs (8)
1207_mouseDragWorkspace.Width = Math.Abs(end.X - start.X); 1208_mouseDragWorkspace.Height = Math.Abs(end.Y - start.Y); 1342Width = Math.Abs(e.X - _mouseDragStart.X), 1343Height = Math.Abs(e.Y - _mouseDragStart.Y) 2196(Math.Abs(_mouseDragLast.X - newPt.X) < minDrag.Width && 2197Math.Abs(_mouseDragLast.Y - newPt.Y) < minDrag.Height)) 2422if (Math.Abs(bounds.X - x) > parentGridSize.Width || Math.Abs(bounds.Y - y) > parentGridSize.Height)
System\Windows\Forms\Design\ControlDesigner.cs (3)
301return new Point(Math.Abs(nativeOffset.X - offset.X), nativeOffset.Y - offset.Y); 1400(Math.Abs(_mouseDragLast.X - x) < minDrag.Width && 1401Math.Abs(_mouseDragLast.Y - y) < minDrag.Height))
System\Windows\Forms\Design\FlowLayoutPanelDesigner .cs (2)
484if (Math.Abs(point1.Y - point2.Y) <= MinIBar) 523if (Math.Abs(point1.X - point2.X) <= MinIBar)
System\Windows\Forms\Design\SelectionUIService.cs (2)
631Math.Abs(screenCoord.X - _mouseDragAnchor.X) < minDragSize.Width && 632Math.Abs(screenCoord.Y - _mouseDragAnchor.Y) < minDragSize.Height)
System.Windows.Forms.Primitives (2)
System\Windows\Forms\Automation\UiaTextRange.cs (2)
364Rectangle endlineRectangle = new(endlinePoint.X, endlinePoint.Y + 2, UiaTextProvider.EndOfLineWidth, Math.Abs(_provider.Logfont.lfHeight) + 1); 745int lineHeight = Math.Abs(_provider.Logfont.lfHeight);
Test.Utilities (1)
src\RoslynAnalyzers\Utilities\Compiler\SmallDictionary.cs (1)
303Math.Abs(a - b) >= 2)
Text.Analyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\SmallDictionary.cs (1)
303Math.Abs(a - b) >= 2)
UIAutomationClientSideProviders (2)
MS\Internal\AutomationProxies\WindowsEditBoxRange.cs (1)
654int height = Math.Abs(_provider.GetLogfont().lfHeight);;
MS\Internal\AutomationProxies\WindowsMenu.cs (1)
2315cMoves = Math.Abs (cMoves);