Scylla Framework
  • API Reference
Search Results for

    Show / Hide Table of Contents
    • Scylla.Core
      • Char
      • FileLog
      • ILogReceiver
      • IScyllaDependencyProvider
      • Log
      • LogCategory
      • LogEntry
      • LogFileFormat
      • LogLevel
      • Num
      • ScyllaAAMode
      • ScyllaAAQuality
      • ScyllaBootstrap
      • ScyllaCore
      • ScyllaCore.Meta
      • ScyllaCreateAssetAttribute
      • ScyllaDependencyInfoData
      • ScyllaMaterialSurface
      • ScyllaRenderPipeline
      • ScyllaShadowResolution
      • Str
      • TextAlignment
      • UnityConsoleLog
    • Scylla.Core.Attributes
      • AttributeValidator
      • CompareOperator
      • ConditionalAttributeBase
      • DisableIfAttribute
      • DisplayNameAttribute
      • EnableIfAttribute
      • FoldoutAttribute
      • FormerlySerializedAsAttribute
      • GroupAttribute
      • HideIfAttribute
      • HideInFilterWindowAttribute
      • HorizontalLineAttribute
      • InfoBoxAttribute
      • InfoType
      • LayerFieldAttribute
      • MinMaxRangeAttribute
      • MonoTextAreaAttribute
      • NotEmptyAttribute
      • NotNullAttribute
      • ReadOnlyAttribute
      • ReflectedTypeAttribute
      • RequiredAttribute
      • SceneFieldAttribute
      • ShowIfAttribute
      • SortingLayerFieldAttribute
      • TagFieldAttribute
      • TitleAttribute
      • ValidateInputAttribute
      • ValidationException
    • Scylla.Core.Config
      • ConfigFileManager
      • ConfigurationRegistry
      • ConfigurationSlotAttribute
      • ConfigurationValidationResult
      • ConsoleLoggingSettings
      • FileLogFormattingSettings
      • FileLoggingSettings
      • IConfigurationRegistry
      • ScyllaConfiguration
      • ScyllaCoreConfiguration
      • ScyllaEventConfiguration
      • ScyllaLoggerConfiguration
      • ValidationSeverity
    • Scylla.Core.Editor
      • CalendarDefinitionEditor
      • ClockDefinitionEditor
      • ColorGradientAssetEditor
      • ColorGradientReducer
      • ColorPaletteAssetEditor
      • DebugCameraEditor
      • DebugEventMonitor
      • DependencySourceType
      • DependencyStatus
      • EventFilterCategory
      • EventLogEntry
      • GameViewCapture
      • IScyllaShaderProvider
      • ScyllaAboutWindow
      • ScyllaBootstrapEditor
      • ScyllaCard
      • ScyllaChoiceCardGroup
      • ScyllaConfigurationEditorBase
      • ScyllaCopyMenu
      • ScyllaCoreConfigurationEditor
      • ScyllaCoreDependencyProvider
      • ScyllaCoreShaderProvider
      • ScyllaDebugWindow
      • ScyllaDependencyDetector
      • ScyllaDependencyGraphElement
      • ScyllaDependencyInfo
      • ScyllaDescriptionBox
      • ScyllaEditorAssetUtil
      • ScyllaEditorAssets
      • ScyllaEditorBase
      • ScyllaEditorClipboard
      • ScyllaEditorColors
      • ScyllaEditorConstants
      • ScyllaEditorIconNames
      • ScyllaEditorLogScope
      • ScyllaEditorPrefs
      • ScyllaEditorSceneUtil
      • ScyllaEditorStyles
      • ScyllaEditorTheme
      • ScyllaEditorUSSClasses
      • ScyllaEventConfigurationEditor
      • ScyllaFontCharacterExtractorWindow
      • ScyllaGettingStartedWindow
      • ScyllaIconPreview
      • ScyllaLoggerConfigurationEditor
      • ScyllaLogoElement
      • ScyllaMenuGroup
      • ScyllaMenuItemAttribute
      • ScyllaMenuItems
      • ScyllaModuleEditor
      • ScyllaModuleStatusIndicator
      • ScyllaModuleWindow
      • ScyllaNameField
      • ScyllaPanel
      • ScyllaPlayModeReloadGuard
      • ScyllaPresetSelector
      • ScyllaSceneConfigurationEditor
      • ScyllaScheduler
      • ScyllaSearchField
      • ScyllaSearchablePopup
      • ScyllaSearchablePopup.Item
      • ScyllaSettingsProvider
      • ScyllaSetupWizard
      • ScyllaShaderInclusionBuildProcessor
      • ScyllaSplitView
      • ScyllaStatusBar
      • ScyllaTabBar
      • ScyllaTimeConfigurationEditor
      • ScyllaToolWindowBase
      • ScyllaToolbar
      • ScyllaValidatedTextField
      • ScyllaWizardWindowBase
      • ScyllaWizardWindowBase.WizardLayout
      • ScyllaWizardWindowBase.WizardStepDef
    • Scylla.Core.Editor.Attributes
      • AttributeReflectionCache
      • ConditionalDrawerBase
      • DisableIfDrawer
      • EnableIfDrawer
      • FoldoutDrawer
      • HideIfDrawer
      • HorizontalLineDrawer
      • InfoBoxDrawer
      • LayerFieldDrawer
      • MinMaxRangeDrawer
      • MonoTextAreaDrawer
      • ReadOnlyDrawer
      • RequiredDrawer
      • SceneFieldDrawer
      • SerializedPropertyExtensions
      • ShowIfDrawer
      • SortingLayerFieldDrawer
      • TagFieldDrawer
      • TitleDrawer
    • Scylla.Core.Editor.Drawers
      • DoubleRangeDrawer
      • FloatRangeDrawer
      • IntRangeDrawer
    • Scylla.Core.Editor.Util.UI.Layout
      • ScyllaUIEdgeInsetsDrawer
      • ScyllaUILayoutMenuItems
      • ScyllaUILengthDrawer
    • Scylla.Core.Events
      • IScyllaEventBus
      • ScyllaEvent
      • ScyllaEventBus
      • ScyllaEventPriority
      • ScyllaEventSubscription
      • ScyllaEvents
      • ScyllaFrameworkInitializedEvent
      • ScyllaFrameworkShutdownEvent
      • ScyllaModuleShutdownEvent
      • ScyllaModuleStartedEvent
    • Scylla.Core.Modules
      • IScyllaModule
      • IScyllaModuleManager
      • ScyllaModule
      • ScyllaModuleDependency
      • ScyllaModuleDependencyIssue
      • ScyllaModuleDependencyIssueType
      • ScyllaModuleDependencyType
      • ScyllaModuleException
      • ScyllaModuleID
      • ScyllaModuleInfo
      • ScyllaModuleManager
      • ScyllaModulePlacement
      • ScyllaModuleState
      • ScyllaModuleTier
    • Scylla.Core.Persistence
      • IScyllaPersistable
      • IScyllaPersistable<TState>
      • ScyllaPartitionID
      • ScyllaPersistenceRegistry
    • Scylla.Core.Scenes
      • HygieneOverride
      • SceneLoadOperation
      • SceneLoadRunner
      • SceneLoadState
      • ScyllaActiveSceneChangedEvent
      • ScyllaSceneConfiguration
      • ScyllaSceneLoadOptions
      • ScyllaSceneLoadProgressEvent
      • ScyllaSceneLoadedEvent
      • ScyllaSceneManager
      • ScyllaSceneUnloadedEvent
      • ScyllaSceneWillLoadEvent
      • ScyllaSceneWillUnloadEvent
    • Scylla.Core.Settings
      • ScyllaProjectSettings
    • Scylla.Core.Structures
      • FractionalHexCoord
      • GridUtil
      • HexCoord
      • HexCornerCoord
      • HexCornerMap<TData>
      • HexCornerMap<TData>.Enumerator
      • HexCornerPosition
      • HexEdgeCoord
      • HexEdgeDirection
      • HexEdgeMap<TData>
      • HexEdgeMap<TData>.Enumerator
      • HexGridLayout
      • HexLayoutMode
      • HexOrientation
      • IScyllaCollection
      • IScyllaCollection<T>
      • IScyllaGraph
      • IScyllaGrid<TCoord, TCell>
      • IScyllaMap<TKey, TValue>
      • IScyllaMutableGraph
      • IScyllaMutableGraph<TNodeData>
      • IScyllaMutableGraph<TNodeData, TEdgeData>
      • IScyllaPausableState<TContext>
      • IScyllaPriorityQueueItem
      • IScyllaReadOnlyGraph
      • IScyllaReadOnlyGraph<TNodeData>
      • IScyllaReadOnlyGraph<TNodeData, TEdgeData>
      • IScyllaState<TContext>
      • IScyllaTransition<TContext>
      • IScyllaTrie
      • IScyllaTrie<TValue>
      • NeighborWriter<TCoord>
      • ScyllaAABB2
      • ScyllaAABB3
      • ScyllaAdjacencyListGraph
      • ScyllaAdjacencyListGraph.Builder
      • ScyllaAdjacencyListGraph.NodeEnumerator
      • ScyllaAdjacencyListGraph.SynchronizedScyllaAdjacencyListGraph
      • ScyllaAdjacencyListGraph<TNodeData>
      • ScyllaAdjacencyListGraph<TNodeData, TEdgeData>
      • ScyllaBVH
      • ScyllaBVH.Builder
      • ScyllaBVHCore
      • ScyllaBitArray
      • ScyllaBitArray.Builder
      • ScyllaBitArray.Enumerator
      • ScyllaBitArray.SynchronizedScyllaBitArray
      • ScyllaBitArrayDOTS
      • ScyllaBitArrayDOTS.Builder
      • ScyllaBitArrayDOTS.Enumerator
      • ScyllaCSRGraph
      • ScyllaCSRGraph.Builder
      • ScyllaCSRGraph<TNodeData>
      • ScyllaCSRGraph<TNodeData, TEdgeData>
      • ScyllaCollectionCapabilities
      • ScyllaCollectionThreadSafety
      • ScyllaCompositeState<TContext>
      • ScyllaDequeDOTS<T>
      • ScyllaDequeDOTS<T>.Builder
      • ScyllaDeque<T>
      • ScyllaDeque<T>.Builder
      • ScyllaDeque<T>.Enumerator
      • ScyllaDeque<T>.SynchronizedScyllaDeque
      • ScyllaDisjointSet
      • ScyllaDisjointSet.Builder
      • ScyllaDisjointSet.SynchronizedScyllaDisjointSet
      • ScyllaDisjointSetDOTS
      • ScyllaDisjointSetDOTS.Builder
      • ScyllaGenericObjectPool<T>
      • ScyllaGenericObjectPool<T>.Builder
      • ScyllaGenericObjectPool<T>.Enumerator
      • ScyllaGenericObjectPool<T>.SynchronizedScyllaGenericObjectPool
      • ScyllaGraphAlgorithms
      • ScyllaGraphDOTS
      • ScyllaGraphDOTS.Builder
      • ScyllaGraphEdge
      • ScyllaGraphEdge<TEdgeData>
      • ScyllaGraphNode
      • ScyllaGraphNodeFlags
      • ScyllaGraphPath
      • ScyllaGraphProperties
      • ScyllaGraphSearchState
      • ScyllaGridGraphAdapter<TCoord, TCell>
      • ScyllaHexGrid<TCell>
      • ScyllaHexGrid<TCell>.Builder
      • ScyllaHexGrid<TCell>.Enumerator
      • ScyllaHexGrid<TCell>.SynchronizedScyllaHexGrid
      • ScyllaHierarchicalStateMachine<TContext>
      • ScyllaKDTree3
      • ScyllaKDTree3.Builder
      • ScyllaKDTree3Core
      • ScyllaKDTree3Core.Node
      • ScyllaLayeredStateMachine<TContext>
      • ScyllaLooseOctree
      • ScyllaLooseOctree.Builder
      • ScyllaLooseOctreeCore
      • ScyllaLooseOctreeUtil
      • ScyllaLooseOctree<T>
      • ScyllaLooseQuadtree
      • ScyllaLooseQuadtree.Builder
      • ScyllaLooseQuadtreeCore
      • ScyllaLooseQuadtreeUtil
      • ScyllaLooseQuadtree<T>
      • ScyllaMapDOTS<TKey, TValue>
      • ScyllaMapDOTS<TKey, TValue>.Builder
      • ScyllaMapEntry<TKey, TValue>
      • ScyllaMap<TKey, TValue>
      • ScyllaMap<TKey, TValue>.Builder
      • ScyllaMap<TKey, TValue>.Enumerator
      • ScyllaMap<TKey, TValue>.SynchronizedScyllaMap
      • ScyllaObjectPool<T>
      • ScyllaObjectPool<T>.Builder
      • ScyllaObjectPool<T>.Enumerator
      • ScyllaObjectPool<T>.SynchronizedScyllaObjectPool
      • ScyllaPausableStateBase<TContext>
      • ScyllaPriorityQueueDOTS<TValue>
      • ScyllaPriorityQueueDOTS<TValue>.Builder
      • ScyllaPriorityQueueItemComparer<T>
      • ScyllaPriorityQueueNode<TValue>
      • ScyllaPriorityQueueOrder
      • ScyllaPriorityQueue<T>
      • ScyllaPriorityQueue<T>.Builder
      • ScyllaPriorityQueue<T>.Enumerator
      • ScyllaPriorityQueue<T>.SynchronizedScyllaPriorityQueue
      • ScyllaPushdownStateMachine<TContext>
      • ScyllaQuadtreePlane
      • ScyllaQueueDOTS<T>
      • ScyllaQueueDOTS<T>.Builder
      • ScyllaQueue<T>
      • ScyllaQueue<T>.Builder
      • ScyllaQueue<T>.Enumerator
      • ScyllaQueue<T>.SynchronizedScyllaQueue
      • ScyllaRay3
      • ScyllaRingBufferDOTS<T>
      • ScyllaRingBufferDOTS<T>.Builder
      • ScyllaRingBufferDOTS<T>.Enumerator
      • ScyllaRingBufferDOTS<T>.ReverseEnumerable
      • ScyllaRingBufferDOTS<T>.ReverseEnumerator
      • ScyllaRingBuffer<T>
      • ScyllaRingBuffer<T>.Builder
      • ScyllaRingBuffer<T>.Enumerator
      • ScyllaRingBuffer<T>.ReverseEnumerable
      • ScyllaRingBuffer<T>.ReverseEnumerator
      • ScyllaRingBuffer<T>.SynchronizedScyllaRingBuffer
      • ScyllaSparseHexGrid<TCell>
      • ScyllaSparseHexGrid<TCell>.Builder
      • ScyllaSparseHexGrid<TCell>.Enumerator
      • ScyllaSparseHexGrid<TCell>.SynchronizedScyllaSparseHexGrid
      • ScyllaSparseSquareGrid<TCell>
      • ScyllaSparseSquareGrid<TCell>.Builder
      • ScyllaSparseSquareGrid<TCell>.Enumerator
      • ScyllaSparseSquareGrid<TCell>.SynchronizedScyllaSparseSquareGrid
      • ScyllaSparseTriGrid<TCell>
      • ScyllaSparseTriGrid<TCell>.Builder
      • ScyllaSparseTriGrid<TCell>.Enumerator
      • ScyllaSparseTriGrid<TCell>.SynchronizedScyllaSparseTriGrid
      • ScyllaSquareGrid<TCell>
      • ScyllaSquareGrid<TCell>.Builder
      • ScyllaSquareGrid<TCell>.Enumerator
      • ScyllaSquareGrid<TCell>.SynchronizedScyllaSquareGrid
      • ScyllaStackDOTS<T>
      • ScyllaStackDOTS<T>.Builder
      • ScyllaStack<T>
      • ScyllaStack<T>.Builder
      • ScyllaStack<T>.Enumerator
      • ScyllaStack<T>.SynchronizedScyllaStack
      • ScyllaStateBase<TContext>
      • ScyllaStateMachine<TContext>
      • ScyllaTransition<TContext>
      • ScyllaTriGrid<TCell>
      • ScyllaTriGrid<TCell>.Builder
      • ScyllaTriGrid<TCell>.Enumerator
      • ScyllaTriGrid<TCell>.SynchronizedScyllaTriGrid
      • ScyllaTrie
      • ScyllaTrie.Builder
      • ScyllaTrie.SynchronizedScyllaTrie
      • ScyllaTrie<TValue>
      • ScyllaTrie<TValue>.Builder
      • ScyllaTrie<TValue>.SynchronizedScyllaTrie
      • ScyllaTypeMap
      • ScyllaTypeMap.Builder
      • ScyllaTypeMap.DiagnosticEntry
      • ScyllaTypeMap.SynchronizedScyllaTypeMap
      • SerializableDictionary<TKey, TValue>
      • SquareAdjacency
      • SquareCoord
      • SquareCornerCoord
      • SquareCornerMap<TData>
      • SquareCornerMap<TData>.Enumerator
      • SquareDistanceMetric
      • SquareEdgeCoord
      • SquareEdgeDirection
      • SquareEdgeMap<TData>
      • SquareEdgeMap<TData>.Enumerator
      • SquareGridLayout
      • TriCoord
      • TriCornerCoord
      • TriCornerMap<TData>
      • TriCornerMap<TData>.Enumerator
      • TriEdgeCoord
      • TriEdgeDirection
      • TriEdgeMap<TData>
      • TriEdgeMap<TData>.Enumerator
      • TriGridLayout
    • Scylla.Core.Time
      • CalendarDefinition
      • CalendarMath
      • ClockDayChangedEvent
      • ClockDebugInfo
      • ClockDefinition
      • ClockEraChangedEvent
      • ClockEvent
      • ClockEventKind
      • ClockHourChangedEvent
      • ClockMinuteChangedEvent
      • ClockMonthChangedEvent
      • ClockPausedEvent
      • ClockRegisteredEvent
      • ClockResumedEvent
      • ClockSeasonChangedEvent
      • ClockSecondChangedEvent
      • ClockState
      • ClockTickEvent
      • ClockTimeScaleChangedEvent
      • ClockUnregisteredEvent
      • ClockWeekdayChangedEvent
      • ClockYearChangedEvent
      • EraDefinition
      • GameDate
      • IClockListener
      • IClockSource
      • IEraConditionProvider
      • ILocationProfile
      • INetworkTimeSyncStrategy
      • ITimeListener
      • LeapYearRule
      • MasterTimeState
      • MonthDefinition
      • PauseMode
      • ScheduleExtensions
      • ScheduleMode
      • ScheduledTickHandle
      • ScyllaClock
      • ScyllaTime
      • ScyllaTimeConfiguration
      • ScyllaTimeDebugInfo
      • SeasonDefinition
      • SmoothTimeScaleTransition
      • TimeDebugOverlay
      • TimeEffectHandle
      • TimeEffects
      • TimeEvent
      • TimeScaleBlendMode
      • TimeScaleModifier
      • TimeScaleModifierHandle
      • TimeScaleModifierStack
      • TimeScaleModifierState
      • TimeTickRunner
      • WeekdayDefinition
    • Scylla.Core.Util
      • ArrayUtil
      • AssemblyUtil
      • CameraUtil
      • CollectionUtil
      • ColorAnalysis
      • ColorBlindnessSimulator
      • ColorBlindnessType
      • ColorHarmony
      • ColorHarmonyHueMode
      • ColorHarmonyType
      • ColorRamps
      • ColorUtil
      • ComponentUtil
      • DateUtil
      • DebugCamera
      • FontUtil
      • FontVariant
      • GameObjectExtensions
      • GameObjectUtil
      • IScyllaInspectorChangeHandler
      • InterfaceUtil
      • Interpolation
      • LightUtil
      • LitMaterialDescriptor
      • ManualResetEventEx
      • MaterialUtil
      • NumberExtensions
      • NumberUtil
      • OptionalPackages
      • PlatformUtil
      • ResourceUtil
      • ScyllaEditorHooks
      • ScyllaPlayModeStateChange
      • SpriteUtil
      • StringUtil
      • TabularText
      • TabularText.Builder
      • TestTextGenerator
      • ThreadUtil
      • TimeUtil
      • Timer
      • TransformExtensions
      • TypeUtil
      • UnicodeRange
      • VirtualTransform
      • WCAGLevel
      • WaitForSettledFrames
    • Scylla.Core.Util.Addressables
      • AddressableErrorCode
      • AddressableException
      • AddressableExtensions
      • AddressableProgress
      • AddressableResult
      • AddressableResult<T>
      • AddressableSettings
      • ManagedAddressableList<T>
      • ManagedAddressable<T>
      • ScyllaAddressables
    • Scylla.Core.Util.Checksum
      • ChecksumAdler32
      • ChecksumCRC16
      • ChecksumCRC32
      • ChecksumFletcher32
      • ChecksumXXHash32
      • ChecksumXXHash64
      • IChecksum
    • Scylla.Core.Util.Compression
      • ArchiveEntryInfo
      • CompressionAlgorithm
      • CompressionErrorCode
      • CompressionException
      • CompressionExtensions
      • CompressionLevel
      • CompressionProgress
      • CompressionResult
      • CompressionResult<T>
      • CompressionSettings
      • IArchiveProvider
      • ICompressionProvider
      • ScyllaCompression
    • Scylla.Core.Util.Crypto
      • CryptoAlgorithm
      • CryptoErrorCode
      • CryptoException
      • CryptoExtensions
      • CryptoSettings
      • ICryptoProvider
      • KeyDerivationHash
      • KeyDerivationSettings
      • ScyllaCrypto
    • Scylla.Core.Util.DebugDraw
      • DebugDraw
      • DebugDrawSpace
      • DebugDrawTextAlign
    • Scylla.Core.Util.Effects
      • ColorAnimationText
      • ColorAnimationTextDirection
      • ColorAnimationTextGradient
    • Scylla.Core.Util.File
      • ConfigFile
      • ConfigFileGroup
      • ConfigFileProperty
      • ConfigFilePropertyType
      • ConfigFileUtil
      • FileErrorCode
      • FileException
      • FileExtensions
      • FilePathExtensions
      • FilePathUtil
      • FileProgress
      • FileSettings
      • ImageFileFormat
      • ImageFileSettings
      • ScyllaFileUtil
    • Scylla.Core.Util.Geom
      • AABB3D
      • BarrelColoringMode
      • BollardColoringMode
      • CappedWallColoringMode
      • Capsule3D
      • ColliderMode
      • CrateColoringMode
      • Ellipse
      • FaceColoringMode
      • IFaceColorResolver
      • OBB3D
      • PaletteFaceColorResolver
      • PaneledWall1ColoringMode
      • PaneledWall2ColoringMode
      • PipeSegmentColoringMode
      • RoundedBoxColoringMode
      • ScyllaArchwayShape
      • ScyllaBarrelShape
      • ScyllaBollardShape
      • ScyllaBoxShape
      • ScyllaCappedWallShape
      • ScyllaCapsuleShape
      • ScyllaColumnShape
      • ScyllaConeShape
      • ScyllaCrateShape
      • ScyllaCurvedStairsShape
      • ScyllaCylinderShape
      • ScyllaDomeShape
      • ScyllaFloorTileShape
      • ScyllaIcoSphereShape
      • ScyllaLadderShape
      • ScyllaLinearStairsShape
      • ScyllaOctahedronShape
      • ScyllaPaneledWall1Shape
      • ScyllaPaneledWall2Shape
      • ScyllaPipeSegmentShape
      • ScyllaPipeShape
      • ScyllaPlaneShape
      • ScyllaPyramidShape
      • ScyllaQuadShape
      • ScyllaRampShape
      • ScyllaRingShape
      • ScyllaRoundedBoxShape
      • ScyllaShapeBase3D
      • ScyllaShapes
      • ScyllaShelvedWallShape
      • ScyllaSignShape
      • ScyllaSkirtedWallShape
      • ScyllaSkyDomeShape
      • ScyllaSphereShape
      • ScyllaSpiralStairsShape
      • ScyllaTorusShape
      • ScyllaTriangularPrismShape
      • ScyllaWallShape
      • ScyllaWallWithDoorShape
      • ScyllaWallWithWindowShape
      • ShapeMaterialCache
      • ShelvedWallColoringMode
      • SignColoringMode
      • Size2D
      • Size3D
      • SkirtedWallColoringMode
      • Sphere3D
      • StairsColoringMode
      • UniformColorResolver
    • Scylla.Core.Util.Math
      • Complex
      • MathUtil
      • Monomial
      • Polynomial
    • Scylla.Core.Util.Noise
      • CellularDistanceType
      • CellularReturnType
      • CellularSettings
      • FractalType
      • NoiseAlgorithm
      • NoiseCurlSampler
      • NoiseDomainWarper
      • NoiseGenerator
      • NoiseSettings
      • PixelNoise
      • PixelNoiseDistribution
      • PixelNoiseSettings
      • WarpSettings
    • Scylla.Core.Util.Palette
      • ColorAssetRegistry
      • ColorGradient
      • ColorGradientAlphaStop
      • ColorGradientAlphaStopData
      • ColorGradientAsset
      • ColorGradientColorSpace
      • ColorGradientData
      • ColorGradientMode
      • ColorGradientStop
      • ColorGradientStopData
      • ColorGradientStopInterpolation
      • ColorPalette
      • ColorPaletteAsset
      • ColorPaletteData
      • ColorPaletteEntry
      • ColorPaletteEntryData
      • ColorPaletteMapping
      • ColorRole
      • ColorStopBlendMode
      • ColorSwatchCollection
      • ColorSwatchCollectionAsset
      • ColorSwatchCollectionData
      • ColorSwatchEntryData
      • MutableColorGradient
      • MutableColorPalette
    • Scylla.Core.Util.ProceduralMapGen
      • BSPSettings
      • CellularAutomataSettings
      • CorridorStyle
      • DoorAxis
      • DoorPlacement
      • DoorPlacementSettings
      • DoorShapeConfig
      • DrunkardWalkSettings
      • FloorplanSettings
      • InstantiationResult
      • MapCellType
      • MapCorridor<TCoord>
      • MapGenResult<TCoord>
      • MapGenSettings
      • MapOverlaySettings
      • MapPatternType
      • MapRoom<TCoord>
      • MazeRoomSettings
      • MazeSettings
      • NoiseThresholdSettings
      • ProceduralMapGenerator
      • ProceduralMapOverlay
      • ProceduralMapPostProcessor
      • RoomCorridorSettings
      • RoomGroup
      • ScyllaProceduralMapInstantiator
      • VoronoiRegionSettings
      • WindingCorridorSettings
    • Scylla.Core.Util.Random
      • AliasTable
      • CryptoRandomSource
      • DiceRoll
      • IProbabilityInfluence
      • IRandomSource
      • MersenneTwister
      • MersenneTwisterState
      • PCG32
      • PCG32State
      • PickHistory
      • PickRecord
      • PoissonDiskSampler
      • PoissonDiskSampler.BoundChecker
      • ProbabilityEntry<T>
      • ProbabilityList<T>
      • ProbabilityNormalizer
      • RandomAlgorithm
      • RandomExtensions
      • RandomID
      • RandomSeeder
      • RandomText
      • RandomUtil
      • RandomUtil.DeterministicRNG
      • RandomUtil.DeterministicRNGState
      • RepeatPreventionMode
      • SelectionStrategy
      • SplitMix64RNG
      • SplitMix64State
      • SystemRandomSource
      • UnityRandomSource
      • Xoroshiro128Plus
      • Xoroshiro128State
      • Xoshiro256StarStar
      • Xoshiro256State
    • Scylla.Core.Util.Ranges
      • DoubleRange
      • FloatRange
      • IntRange
    • Scylla.Core.Util.Serialization
      • ArraySerializer<T>
      • BinaryTypeTag
      • BoolSerializer
      • BoundsSerializer
      • ByteArraySerializer
      • ByteSerializer
      • CharSerializer
      • Color32Serializer
      • ColorSerializer
      • DateTimeOffsetSerializer
      • DateTimeSerializer
      • DecimalSerializer
      • DefaultValueHandling
      • DictionarySerializer<TKey, TValue>
      • DoubleSerializer
      • EnumSerializer<T>
      • FloatSerializer
      • GuidSerializer
      • HashSetSerializer<T>
      • IScyllaReader
      • IScyllaWriter
      • ISerializationContext
      • ITypeSerializer
      • ITypeSerializer<T>
      • IntSerializer
      • LayerMaskSerializer
      • ListSerializer<T>
      • LongSerializer
      • NullHandling
      • PropertyMetadata
      • QuaternionSerializer
      • QueueSerializer<T>
      • RectIntSerializer
      • RectSerializer
      • ReferenceHandling
      • ReferenceTracker
      • ReflectionSerializer
      • SByteSerializer
      • ScyllaBinaryReader
      • ScyllaBinaryWriter
      • ScyllaIgnoreAttribute
      • ScyllaIncludeAttribute
      • ScyllaJSONReader
      • ScyllaJSONWriter
      • ScyllaMigrationAttribute
      • ScyllaPropertyAttribute
      • ScyllaSerializableAttribute
      • ScyllaSerialization
      • SerializationContext
      • SerializationEngine
      • SerializationException
      • SerializationFormat
      • SerializationResult
      • SerializationResult<T>
      • SerializationSettings
      • SerializationSettings.Builder
      • SerializationToken
      • ShortSerializer
      • StackSerializer<T>
      • StringSerializer
      • TimeSpanSerializer
      • TypeMetadata
      • TypeMetadataCache
      • TypeSerializerAdapter<T>
      • TypeSerializerBase<T>
      • UIntSerializer
      • ULongSerializer
      • UShortSerializer
      • Vector2IntSerializer
      • Vector2Serializer
      • Vector3IntSerializer
      • Vector3Serializer
      • Vector4Serializer
    • Scylla.Core.Util.Tween
      • Ease
      • EaseType
      • ITween
      • LoopType
      • ScyllaShapeTweenExtensions
      • ScyllaTween
      • SequenceItem
      • SequenceItemType
      • TweenAudioSourceExtensions
      • TweenBase
      • TweenCanvasGroupExtensions
      • TweenColor
      • TweenErrorCode
      • TweenException
      • TweenExtensions
      • TweenFloat
      • TweenID
      • TweenLerp
      • TweenManager
      • TweenMaterialExtensions
      • TweenPool
      • TweenQuaternion
      • TweenRectTransformExtensions
      • TweenSequence
      • TweenSettings
      • TweenSpriteRendererExtensions
      • TweenState
      • TweenTransformExtensions
      • TweenVector2
      • TweenVector3
      • TweenVector4
      • TweenVisualElementExtensions
      • Tween<T>
    • Scylla.Core.Util.UI
      • DebugCanvasUtil
      • GradientBackground
      • IUIText
      • IUITextField
      • LineScrollTextArea
      • LineScrollTextAreaBuilder
      • LineScrollTextBuffer
      • LineScrollTextBuffer.Builder
      • LineScrollTextBuffer.LogicalLine
      • LineScrollTextBufferLineAddedEvent
      • LineScrollTextBufferScrolledEvent
      • LineScrollWindow
      • LineScrollWindow.Enumerator
      • ScrollDirection
      • ScrollPhysics
      • ScrollTextArea
      • ScrollTextAreaBuilder
      • ScrollTextAreaDragEndedEvent
      • ScrollTextAreaDragStartedEvent
      • ScrollTextAreaScrolledEvent
      • ScrollTextBuffer
      • ScrollTextBuffer.Builder
      • ScrollTextBuffer.ScrollTextLine
      • ScrollTextBufferLineAddedEvent
      • ScrollTextLineView
      • ScyllaScrollRect
      • ScyllaUIAdaptiveStack
      • ScyllaUIAlignment
      • ScyllaUIAspectBreakpoint
      • ScyllaUICrossAlignment
      • ScyllaUIEdgeInsets
      • ScyllaUIFitMode
      • ScyllaUIFlexElement
      • ScyllaUIGrid
      • ScyllaUIGridItem
      • ScyllaUIHStack
      • ScyllaUILayoutAnimator
      • ScyllaUILayoutDebugDraw
      • ScyllaUILayoutDebugDrawConfig
      • ScyllaUILayoutGizmos
      • ScyllaUILayoutRoot
      • ScyllaUILayoutStyle
      • ScyllaUILength
      • ScyllaUILengthUnit
      • ScyllaUIPositioned
      • ScyllaUISafeArea
      • ScyllaUIScreenMargin
      • ScyllaUISizeMode
      • ScyllaUISpacer
      • ScyllaUIStackBase
      • ScyllaUIText
      • ScyllaUITextGroup
      • ScyllaUITrack
      • ScyllaUITrackSizingMode
      • ScyllaUIVStack
      • ScyllaUIZStack
      • TMPSettings
      • TMPUtil
      • TextSelectionPosition
      • TextSelectionRange
      • UIAlignment
      • UIAnchor
      • UIAnchors
      • UIFontReference
      • UIFontStyle
      • UIMargin
      • UIPadding
      • UITextBuilder
      • UITextComponent
      • UITextFactory
      • UITextFieldBuilder
      • UITextFieldComponent
      • UIUtil
      • VisualLine
    • Scylla.Core.Util.UIToolkit
      • ScyllaSafeScheduler
    • Scylla.Core.Util.Units
      • AreaUnit
      • DataUnit
      • LengthUnit
      • MassUnit
      • PressureUnit
      • SpeedUnit
      • TemperatureUnit
      • TimeFormat
      • TimeUnit

    Class NumberUtil

    Provides a comprehensive set of deterministic numeric utility methods covering clamping, range checks, floating-point comparisons, rounding, interpolation, modular arithmetic, safe division, power-of-two alignment, angle operations, and common math helpers across all standard numeric types.

    Inheritance
    object
    NumberUtil
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Scylla.Core.Util
    Assembly: ScyllaCore.dll
    Syntax
    public static class NumberUtil
    Remarks

    Float-based methods delegate to UnityEngine.Mathf where available, while double and decimal overloads use Math directly. This ensures identical results to Unity's built-in math on float inputs.

    All methods are deterministic and contain no randomness. For random number generation see RandomUtil.

    Floating-point equality comparisons use Approximately(float, float, float) rather than == to avoid false negatives due to floating-point rounding. The default tolerance constants are EPSILON (1e-6f) for float and EPSILON_D (1e-12) for double.

    Fields

    EPSILON

    Default tolerance used by float comparison helpers such as Approximately(float, float, float) and IsNearlyZero(float, float). Equal to 1e-6.

    Declaration
    public const float EPSILON = 1E-06
    Field Value
    Type Description
    float
    Remarks

    This value is significantly tighter than UnityEngine.Mathf.Epsilon (which is the smallest representable positive float) but loose enough to absorb typical single-precision rounding errors in game math. Increase the tolerance when comparing values that have accumulated over many arithmetic operations.

    EPSILON_D

    Default tolerance used by double comparison helpers such as Approximately(double, double, double) and IsNearlyZero(double, double). Equal to 1e-12.

    Declaration
    public const double EPSILON_D = 1E-12
    Field Value
    Type Description
    double
    Remarks

    This tolerance is appropriate for double-precision values where roughly 12 significant decimal digits of precision are expected. Tighten or loosen it per-call when the algorithm demands higher or lower accuracy.

    Methods

    AbsDiff(int, int)

    Returns the absolute (unsigned) difference between two integers - equivalent to Math.Abs(a - b) but without the risk of an intermediate overflow when a and b have opposite signs near the bounds of int.

    Declaration
    public static int AbsDiff(int a, int b)
    Parameters
    Type Name Description
    int a

    The first integer value.

    int b

    The second integer value.

    Returns
    Type Description
    int

    The absolute difference between the two integers.

    AbsDiff(long, long)

    Calculates the absolute difference between two long integers.

    Declaration
    public static long AbsDiff(long a, long b)
    Parameters
    Type Name Description
    long a

    The first long integer.

    long b

    The second long integer.

    Returns
    Type Description
    long

    The absolute difference between the two long integers.

    AbsDiff(uint, uint)

    Calculates the absolute difference between two unsigned integers.

    Declaration
    public static uint AbsDiff(uint a, uint b)
    Parameters
    Type Name Description
    uint a

    The first unsigned integer.

    uint b

    The second unsigned integer.

    Returns
    Type Description
    uint

    The absolute difference between the two values.

    AbsDiff(ulong, ulong)

    Calculates the absolute difference between two unsigned long integers.

    Declaration
    public static ulong AbsDiff(ulong a, ulong b)
    Parameters
    Type Name Description
    ulong a

    The first unsigned long integer.

    ulong b

    The second unsigned long integer.

    Returns
    Type Description
    ulong

    The absolute difference between the two values.

    AlignDown(uint, uint)

    Aligns the given value down to the nearest multiple of the specified alignment.

    Declaration
    public static uint AlignDown(uint value, uint alignment)
    Parameters
    Type Name Description
    uint value

    The value to be aligned down.

    uint alignment

    The alignment value, which must be greater than 0.

    Returns
    Type Description
    uint

    The largest multiple of the alignment that is less than or equal to the value.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown if the alignment is 0.

    AlignDown(ulong, ulong)

    Aligns a value down to the nearest multiple of a specified alignment.

    Declaration
    public static ulong AlignDown(ulong value, ulong alignment)
    Parameters
    Type Name Description
    ulong value

    The value to align down.

    ulong alignment

    The alignment value, which must be greater than 0.

    Returns
    Type Description
    ulong

    The largest multiple of the alignment less than or equal to the original value.

    AlignUp(uint, uint)

    Aligns a value up to the nearest multiple of the specified alignment.

    Declaration
    public static uint AlignUp(uint value, uint alignment)
    Parameters
    Type Name Description
    uint value

    The value to align.

    uint alignment

    The alignment boundary to which the value will be aligned.

    Returns
    Type Description
    uint

    The value aligned to the nearest multiple of the alignment.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown if alignment is 0.

    OverflowException

    Thrown if the aligned value would overflow.

    AlignUp(ulong, ulong)

    Aligns a value up to the nearest multiple of the specified alignment.

    Declaration
    public static ulong AlignUp(ulong value, ulong alignment)
    Parameters
    Type Name Description
    ulong value

    The value to align.

    ulong alignment

    The alignment boundary. Must be greater than 0.

    Returns
    Type Description
    ulong

    The aligned value, which is the smallest multiple of the alignment greater than or equal to the input value.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown if alignment is 0.

    OverflowException

    Thrown if the aligned value exceeds the range of ulong.

    Approximately(double, double, double)

    Determines whether two double precision floating-point numbers are approximately equal within a specified tolerance.

    Declaration
    public static bool Approximately(double a, double b, double epsilon = 1E-12)
    Parameters
    Type Name Description
    double a

    The first double value to compare.

    double b

    The second double value to compare.

    double epsilon

    The maximum difference between the two values for them to be considered approximately equal. Must be non-negative.

    Returns
    Type Description
    bool

    True if the absolute difference between a and b is less than or equal to epsilon; otherwise, false.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown if epsilon is negative.

    Approximately(float, float, float)

    Determines whether two floating-point numbers are approximately equal, within a specified tolerance.

    Declaration
    public static bool Approximately(float a, float b, float epsilon = 1E-06)
    Parameters
    Type Name Description
    float a

    The first floating-point number to compare.

    float b

    The second floating-point number to compare.

    float epsilon

    The maximum difference allowed for the two numbers to be considered equal. Defaults to EPSILON.

    Returns
    Type Description
    bool

    true if the absolute difference between a and b is less than or equal to epsilon; otherwise, false.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown if epsilon is negative.

    CeilToInt(double)

    Rounds the specified floating-point value up to the nearest higher integer.

    Declaration
    public static int CeilToInt(double value)
    Parameters
    Type Name Description
    double value

    The floating-point value to ceil.

    Returns
    Type Description
    int

    The smallest integer value greater than or equal to the specified value.

    CeilToInt(float)

    Rounds the specified floating-point value to the smallest integer greater than or equal to it.

    Declaration
    public static int CeilToInt(float value)
    Parameters
    Type Name Description
    float value

    The floating-point value to be rounded up.

    Returns
    Type Description
    int

    The smallest integer greater than or equal to the specified value.

    Clamp(decimal, decimal, decimal)

    Clamps an integer value to the inclusive range [min, max]. If value is below the minimum, the minimum is returned; if it is above the maximum, the maximum is returned; otherwise the value is returned unchanged.

    Declaration
    public static decimal Clamp(decimal value, decimal min, decimal max)
    Parameters
    Type Name Description
    decimal value

    The value to clamp.

    decimal min

    The inclusive lower bound of the range.

    decimal max

    The inclusive upper bound of the range.

    Returns
    Type Description
    decimal

    The clamped value in the range [min, max].

    Exceptions
    Type Condition
    ArgumentException

    Thrown when min is greater than max.

    Clamp(double, double, double)

    Clamps a double-precision floating-point value to the inclusive range [min, max].

    Declaration
    public static double Clamp(double value, double min, double max)
    Parameters
    Type Name Description
    double value

    The value to clamp.

    double min

    The inclusive lower bound of the range.

    double max

    The inclusive upper bound of the range.

    Returns
    Type Description
    double

    The clamped value in the range [min, max].

    Exceptions
    Type Condition
    ArgumentException

    Thrown when min is greater than max.

    Clamp(int, int, int)

    Clamps an integer value to the inclusive range [min, max]. If value is below the minimum, the minimum is returned; if it is above the maximum, the maximum is returned; otherwise the value is returned unchanged.

    Declaration
    public static int Clamp(int value, int min, int max)
    Parameters
    Type Name Description
    int value

    The value to clamp.

    int min

    The inclusive lower bound of the range.

    int max

    The inclusive upper bound of the range.

    Returns
    Type Description
    int

    The clamped value in the range [min, max].

    Exceptions
    Type Condition
    ArgumentException

    Thrown when min is greater than max.

    Clamp(long, long, long)

    Clamps a 64-bit signed integer value to the inclusive range [min, max].

    Declaration
    public static long Clamp(long value, long min, long max)
    Parameters
    Type Name Description
    long value

    The 64-bit signed integer value to clamp.

    long min

    The inclusive lower bound of the range.

    long max

    The inclusive upper bound of the range.

    Returns
    Type Description
    long

    The clamped value in the range [min, max].

    Exceptions
    Type Condition
    ArgumentException

    Thrown when min is greater than max.

    Clamp(float, float, float)

    Clamps a single-precision floating-point value to the inclusive range [min, max].

    Declaration
    public static float Clamp(float value, float min, float max)
    Parameters
    Type Name Description
    float value

    The value to clamp.

    float min

    The inclusive lower bound of the range.

    float max

    The inclusive upper bound of the range.

    Returns
    Type Description
    float

    The clamped value in the range [min, max].

    Exceptions
    Type Condition
    ArgumentException

    Thrown when min is greater than max.

    Clamp(uint, uint, uint)

    Clamps an unsigned 32-bit integer value to the inclusive range [min, max].

    Declaration
    public static uint Clamp(uint value, uint min, uint max)
    Parameters
    Type Name Description
    uint value

    The unsigned integer value to clamp.

    uint min

    The inclusive lower bound of the range.

    uint max

    The inclusive upper bound of the range.

    Returns
    Type Description
    uint

    The clamped value in the range [min, max].

    Exceptions
    Type Condition
    ArgumentException

    Thrown when min is greater than max.

    Clamp(ulong, ulong, ulong)

    Clamps an unsigned 64-bit integer value to the inclusive range [min, max].

    Declaration
    public static ulong Clamp(ulong value, ulong min, ulong max)
    Parameters
    Type Name Description
    ulong value

    The unsigned 64-bit integer value to clamp.

    ulong min

    The inclusive lower bound of the range.

    ulong max

    The inclusive upper bound of the range.

    Returns
    Type Description
    ulong

    The clamped value in the range [min, max].

    Exceptions
    Type Condition
    ArgumentException

    Thrown when min is greater than max.

    Clamp01(double)

    Clamps a double-precision floating-point value to the inclusive range [0, 1].

    Declaration
    public static double Clamp01(double value)
    Parameters
    Type Name Description
    double value

    The value to clamp.

    Returns
    Type Description
    double

    The clamped value, which will be within the range [0, 1].

    Clamp01(float)

    Clamps a given value to the inclusive range of [0, 1].

    Declaration
    public static float Clamp01(float value)
    Parameters
    Type Name Description
    float value

    The value to clamp.

    Returns
    Type Description
    float

    The clamped value, which will be within the range [0, 1].

    Cube(decimal)

    Returns the cube of the specified decimal value (value * value * value).

    Declaration
    public static decimal Cube(decimal value)
    Parameters
    Type Name Description
    decimal value

    The decimal value to cube. The sign is preserved in the result.

    Returns
    Type Description
    decimal

    value * value * value.

    Cube(double)

    Returns the cube of the specified double value (value * value * value).

    Declaration
    public static double Cube(double value)
    Parameters
    Type Name Description
    double value

    The double-precision value to cube. The sign is preserved in the result.

    Returns
    Type Description
    double

    value * value * value.

    Cube(int)

    Returns the cube of the specified int value (value * value * value). Useful as a concise alternative to Math.Pow(value, 3) without a cast or allocation.

    Declaration
    public static int Cube(int value)
    Parameters
    Type Name Description
    int value

    The integer value to cube. The sign is preserved in the result.

    Returns
    Type Description
    int

    value * value * value. Note that overflow is not checked; very large inputs will wrap silently.

    Cube(long)

    Returns the cube of the specified long value (value * value * value).

    Declaration
    public static long Cube(long value)
    Parameters
    Type Name Description
    long value

    The 64-bit integer value to cube. The sign is preserved in the result.

    Returns
    Type Description
    long

    value * value * value. Note that overflow is not checked; very large inputs will wrap silently.

    Cube(float)

    Returns the cube of the specified float value (value * value * value).

    Declaration
    public static float Cube(float value)
    Parameters
    Type Name Description
    float value

    The float value to cube. The sign is preserved in the result.

    Returns
    Type Description
    float

    value * value * value.

    DegToRad(float)

    Converts an angle from degrees to radians.

    Declaration
    public static float DegToRad(float degrees)
    Parameters
    Type Name Description
    float degrees

    The angle in degrees.

    Returns
    Type Description
    float

    The equivalent angle in radians.

    DeltaAngleDeg(float, float)

    Calculates the shortest signed angle difference (in degrees) from the current angle to the target angle. The result is normalized to the range [-180, 180).

    Declaration
    public static float DeltaAngleDeg(float current, float target)
    Parameters
    Type Name Description
    float current

    The current angle in degrees.

    float target

    The target angle in degrees.

    Returns
    Type Description
    float

    The shortest signed angle difference (in degrees) from the current angle to the target angle, within the range [-180, 180).

    DeltaAngleRad(float, float)

    Calculates the shortest signed angle difference, in radians, between the specified current and target angles. The returned angle will be within the range [-π, π).

    Declaration
    public static float DeltaAngleRad(float current, float target)
    Parameters
    Type Name Description
    float current

    The current angle in radians.

    float target

    The target angle in radians.

    Returns
    Type Description
    float

    The shortest signed angle difference in radians, within the range [-π, π).

    EnsureFinite(double, string)

    Ensures that the provided value is finite (neither NaN nor infinity).

    Declaration
    public static double EnsureFinite(double value, string name)
    Parameters
    Type Name Description
    double value

    The value to validate as finite.

    string name

    The name of the parameter being validated, used in exception messages.

    Returns
    Type Description
    double

    The original value if it is finite.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown when the value is NaN or infinity, indicating that it is not a finite number.

    EnsureFinite(float, string)

    Ensures that the provided value is finite (neither NaN nor infinity).

    Declaration
    public static float EnsureFinite(float value, string name)
    Parameters
    Type Name Description
    float value

    The value to validate as finite.

    string name

    The name of the parameter being validated, used in exception messages.

    Returns
    Type Description
    float

    The original value if it is finite.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown when the value is NaN or infinity, indicating that it is not a finite number.

    EnsureFiniteNonNegative(double, string)

    Ensures that the provided value is finite and non-negative.

    Declaration
    public static double EnsureFiniteNonNegative(double value, string name)
    Parameters
    Type Name Description
    double value

    The value to validate.

    string name

    The name of the parameter being validated, used in exception messages.

    Returns
    Type Description
    double

    The validated value, if it is both finite and non-negative.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown if the value is NaN, infinity, or less than 0.

    EnsureFiniteNonNegative(float, string)

    Ensures that the provided value is finite and non-negative.

    Declaration
    public static float EnsureFiniteNonNegative(float value, string name)
    Parameters
    Type Name Description
    float value

    The value to validate.

    string name

    The name of the parameter being validated, used in exception messages.

    Returns
    Type Description
    float

    The validated value, if it is both finite and non-negative.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown if the value is NaN, infinity, or less than 0.

    FloorToInt(double)

    Floors the specified float value to the nearest lower integer.

    Declaration
    public static int FloorToInt(double value)
    Parameters
    Type Name Description
    double value

    The float value to floor.

    Returns
    Type Description
    int

    The largest integer less than or equal to the specified float value.

    FloorToInt(float)

    Floors the specified float value to the nearest lower integer.

    Declaration
    public static int FloorToInt(float value)
    Parameters
    Type Name Description
    float value

    The float value to floor.

    Returns
    Type Description
    int

    The largest integer less than or equal to the specified value.

    InverseLerp(double, double, double)

    Calculates the normalized interpolation factor for a value within a specified range, clamped to the range [0, 1].

    Declaration
    public static double InverseLerp(double a, double b, double value)
    Parameters
    Type Name Description
    double a

    The start of the range.

    double b

    The end of the range.

    double value

    The value to calculate the interpolation factor for.

    Returns
    Type Description
    double

    The normalized interpolation factor, clamped to the range [0, 1].

    InverseLerp(float, float, float)

    Computes a clamped interpolation factor t in the range [0, 1] such that Lerp(a, b, t) equals the specified value. Returns 0 when a is equal to b.

    Declaration
    public static float InverseLerp(float a, float b, float value)
    Parameters
    Type Name Description
    float a

    The start value of the range.

    float b

    The end value of the range.

    float value

    The value for which the interpolation factor is computed.

    Returns
    Type Description
    float

    The interpolated factor t in the range [0, 1].

    InverseLerpUnclamped(double, double, double)

    Calculates the linear parameter t that produces the interpolant value within an unclamped range. Returns 0 when a is approximately equal to b.

    Declaration
    public static double InverseLerpUnclamped(double a, double b, double value)
    Parameters
    Type Name Description
    double a

    The start of the range.

    double b

    The end of the range.

    double value

    The value for which to calculate the parameter t within the range.

    Returns
    Type Description
    double

    The linear parameter t that corresponds to the value within the range [a, b].

    InverseLerpUnclamped(float, float, float)

    Computes an unclamped interpolation factor t such that LerpUnclamped(a, b, t) == value. Returns 0 when a is approximately equal to b.

    Declaration
    public static float InverseLerpUnclamped(float a, float b, float value)
    Parameters
    Type Name Description
    float a

    The start value, corresponding to t = 0.

    float b

    The end value, corresponding to t = 1.

    float value

    The value to map between a and b.

    Returns
    Type Description
    float

    The unclamped interpolation factor t.

    IsBetween(decimal, decimal, decimal, bool)

    Determines whether a value lies within the specified range, optionally including the boundaries.

    Declaration
    public static bool IsBetween(decimal value, decimal min, decimal max, bool inclusive = true)
    Parameters
    Type Name Description
    decimal value

    The value to check.

    decimal min

    The lower bound of the range.

    decimal max

    The upper bound of the range.

    bool inclusive

    Specifies whether the boundaries should be included in the range. Defaults to true.

    Returns
    Type Description
    bool

    True if the value lies within the range; otherwise, false.

    IsBetween(double, double, double, bool)

    Determines whether a value is within the specified range.

    Declaration
    public static bool IsBetween(double value, double min, double max, bool inclusive = true)
    Parameters
    Type Name Description
    double value

    The value to check.

    double min

    The lower bound of the range.

    double max

    The upper bound of the range.

    bool inclusive

    Specifies whether the bounds are inclusive. If true, the range is [min, max]. If false, the range is (min, max).

    Returns
    Type Description
    bool

    True if the value is within the range; otherwise, false.

    IsBetween(int, int, int, bool)

    Determines if a value is within a specified range, either inclusive or exclusive of the boundaries.

    Declaration
    public static bool IsBetween(int value, int min, int max, bool inclusive = true)
    Parameters
    Type Name Description
    int value

    The value to evaluate.

    int min

    The lower boundary of the range.

    int max

    The upper boundary of the range.

    bool inclusive

    Specifies whether the boundaries are inclusive. If true, the range is inclusive of the boundaries; otherwise, the range is exclusive.

    Returns
    Type Description
    bool

    True if the value is within the specified range, otherwise false.

    Exceptions
    Type Condition
    ArgumentException

    Thrown when the min value is greater than the max value.

    IsBetween(long, long, long, bool)

    Determines whether a value is within the range defined by the specified minimum and maximum values.

    Declaration
    public static bool IsBetween(long value, long min, long max, bool inclusive = true)
    Parameters
    Type Name Description
    long value

    The value to check.

    long min

    The minimum value of the range.

    long max

    The maximum value of the range.

    bool inclusive

    Indicates whether the check should include the boundary values. If true, the range is inclusive; otherwise, it is exclusive.

    Returns
    Type Description
    bool

    True if the value is within the specified range; otherwise, false.

    IsBetween(float, float, float, bool)

    Determines whether a value lies within the specified range, with an option to include or exclude the boundaries.

    Declaration
    public static bool IsBetween(float value, float min, float max, bool inclusive = true)
    Parameters
    Type Name Description
    float value

    The value to test.

    float min

    The lower bound of the range.

    float max

    The upper bound of the range.

    bool inclusive

    Determines if the boundary values should be included in the range. If true, the range is inclusive; otherwise, it is exclusive.

    Returns
    Type Description
    bool

    True if the value is within the specified range; otherwise, false.

    IsBetween(uint, uint, uint, bool)

    Determines if a value lies within the specified range, with an option to include or exclude the boundaries.

    Declaration
    public static bool IsBetween(uint value, uint min, uint max, bool inclusive = true)
    Parameters
    Type Name Description
    uint value

    The value to check.

    uint min

    The minimum value of the range.

    uint max

    The maximum value of the range.

    bool inclusive

    Indicates whether the range includes the boundaries. Defaults to true.

    Returns
    Type Description
    bool

    True if the value lies within the range; otherwise, false.

    IsBetween(ulong, ulong, ulong, bool)

    Determines whether a value is within the range defined by the specified minimum and maximum values.

    Declaration
    public static bool IsBetween(ulong value, ulong min, ulong max, bool inclusive = true)
    Parameters
    Type Name Description
    ulong value

    The value to check.

    ulong min

    The minimum value of the range.

    ulong max

    The maximum value of the range.

    bool inclusive

    Determines if the boundaries are inclusive. If true, the range includes min and max; otherwise, it excludes them.

    Returns
    Type Description
    bool

    True if the value is within the specified range; otherwise, false.

    IsEven(int)

    Returns true if the specified int value is even (divisible by 2 with no remainder). Uses a bitwise AND for a branchless, allocation-free check. Correctly handles negative values.

    Declaration
    public static bool IsEven(int value)
    Parameters
    Type Name Description
    int value

    The integer to evaluate.

    Returns
    Type Description
    bool

    true if the value is even; false if it is odd.

    IsEven(long)

    Returns true if the specified long value is even. Correctly handles negative values.

    Declaration
    public static bool IsEven(long value)
    Parameters
    Type Name Description
    long value

    The 64-bit integer to evaluate.

    Returns
    Type Description
    bool

    true if the value is even; false if it is odd.

    IsEven(uint)

    Returns true if the specified uint value is even.

    Declaration
    public static bool IsEven(uint value)
    Parameters
    Type Name Description
    uint value

    The unsigned integer to evaluate.

    Returns
    Type Description
    bool

    true if the value is even; false if it is odd.

    IsEven(ulong)

    Returns true if the specified ulong value is even.

    Declaration
    public static bool IsEven(ulong value)
    Parameters
    Type Name Description
    ulong value

    The unsigned 64-bit integer to evaluate.

    Returns
    Type Description
    bool

    true if the value is even; false if it is odd.

    IsFinite(double)

    Determines whether the specified double-precision floating-point value is finite.

    Declaration
    public static bool IsFinite(double value)
    Parameters
    Type Name Description
    double value

    The double value to check for finiteness.

    Returns
    Type Description
    bool

    True if the value is finite (neither NaN nor infinity); otherwise, false.

    IsFinite(float)

    Determines whether the specified floating-point value is finite (not NaN and not ±Infinity).

    Declaration
    public static bool IsFinite(float value)
    Parameters
    Type Name Description
    float value

    The floating-point value to evaluate.

    Returns
    Type Description
    bool

    True if the value is finite; otherwise, false.

    IsNearlyZero(double, double)

    Determines whether a given double-precision floating-point value is nearly zero, within a specified margin of error.

    Declaration
    public static bool IsNearlyZero(double value, double epsilon = 1E-12)
    Parameters
    Type Name Description
    double value

    The value to check.

    double epsilon

    The allowable margin of error to consider the value as nearly zero. Must be greater than or equal to 0.

    Returns
    Type Description
    bool

    True if the absolute value is less than or equal to the specified epsilon; otherwise, false.

    IsNearlyZero(float, float)

    Determines whether the specified value is within a defined epsilon range of zero.

    Declaration
    public static bool IsNearlyZero(float value, float epsilon = 1E-06)
    Parameters
    Type Name Description
    float value

    The value to evaluate.

    float epsilon

    The permissible range for the value to be considered nearly zero. Must be greater than or equal to zero.

    Returns
    Type Description
    bool

    True if the value is within the specified epsilon range of zero; otherwise, false.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown when the epsilon is negative.

    IsOdd(int)

    Returns true if the specified int value is odd (not divisible by 2 without a remainder). Uses a bitwise AND for a branchless, allocation-free check. Correctly handles negative values.

    Declaration
    public static bool IsOdd(int value)
    Parameters
    Type Name Description
    int value

    The integer value to evaluate.

    Returns
    Type Description
    bool

    true if the value is odd; false if it is even.

    IsOdd(long)

    Returns true if the specified long value is odd. Correctly handles negative values.

    Declaration
    public static bool IsOdd(long value)
    Parameters
    Type Name Description
    long value

    The 64-bit integer to evaluate.

    Returns
    Type Description
    bool

    true if the value is odd; false if it is even.

    IsOdd(uint)

    Returns true if the specified uint value is odd.

    Declaration
    public static bool IsOdd(uint value)
    Parameters
    Type Name Description
    uint value

    The unsigned integer to evaluate.

    Returns
    Type Description
    bool

    true if the value is odd; false if it is even.

    IsOdd(ulong)

    Returns true if the specified ulong value is odd.

    Declaration
    public static bool IsOdd(ulong value)
    Parameters
    Type Name Description
    ulong value

    The unsigned 64-bit integer to evaluate.

    Returns
    Type Description
    bool

    true if the value is odd; false if it is even.

    IsPowerOfTwo(uint)

    Determines whether the specified value is a power of two.

    Declaration
    public static bool IsPowerOfTwo(uint value)
    Parameters
    Type Name Description
    uint value

    The value to check.

    Returns
    Type Description
    bool

    True if the value is a power of two; otherwise, false.

    IsPowerOfTwo(ulong)

    Determines whether the specified value is a power of two.

    Declaration
    public static bool IsPowerOfTwo(ulong value)
    Parameters
    Type Name Description
    ulong value

    The value to check.

    Returns
    Type Description
    bool

    True if the value is a power of two; otherwise, false.

    Lerp(double, double, double)

    Linearly interpolates between two values based on a weight parameter t.

    Declaration
    public static double Lerp(double a, double b, double t)
    Parameters
    Type Name Description
    double a

    The starting value.

    double b

    The target value.

    double t

    The interpolation factor, typically in the range [0, 1].

    Returns
    Type Description
    double

    The interpolated value, which is a combination of a and b based on t.

    Lerp(float, float, float)

    Linearly interpolates between two values based on a parameter t, while clamping t to the range [0, 1].

    Declaration
    public static float Lerp(float a, float b, float t)
    Parameters
    Type Name Description
    float a

    The starting value of the interpolation.

    float b

    The ending value of the interpolation.

    float t

    The parameter that determines the interpolation factor. It is clamped to the range [0, 1].

    Returns
    Type Description
    float

    The interpolated value between a and b.

    LerpAngleDeg(float, float, float)

    Interpolates between two angles in degrees, taking into account angle wrapping (e.g., -180° to 180° or 0° to 360°) and clamping the interpolation factor to the range [0, 1].

    Declaration
    public static float LerpAngleDeg(float a, float b, float t)
    Parameters
    Type Name Description
    float a

    The starting angle in degrees.

    float b

    The target angle in degrees.

    float t

    The interpolation factor, where 0 represents the starting angle and 1 represents the target angle.

    Returns
    Type Description
    float

    The interpolated angle in degrees.

    LerpUnclamped(double, double, double)

    Interpolates between two values without clamping the interpolation factor.

    Declaration
    public static double LerpUnclamped(double a, double b, double t)
    Parameters
    Type Name Description
    double a

    The starting value of the interpolation.

    double b

    The ending value of the interpolation.

    double t

    The interpolation factor. This value is not clamped and can extend beyond the range [0, 1].

    Returns
    Type Description
    double

    The interpolated value.

    LerpUnclamped(float, float, float)

    Linearly interpolates between two values without clamping the interpolation factor.

    Declaration
    public static float LerpUnclamped(float a, float b, float t)
    Parameters
    Type Name Description
    float a

    The start value of the interpolation.

    float b

    The end value of the interpolation.

    float t

    The interpolation factor, which is not clamped. Values less than 0 will extrapolate below a, and values greater than 1 will extrapolate beyond b.

    Returns
    Type Description
    float

    The interpolated value between a and b based on t.

    Mod(decimal, decimal)

    Computes the modulus of the given value and divisor, ensuring the result is always non-negative.

    Declaration
    public static decimal Mod(decimal value, decimal m)
    Parameters
    Type Name Description
    decimal value

    The value to compute the modulus for.

    decimal m

    The divisor. Must be greater than zero.

    Returns
    Type Description
    decimal

    The modulus result, which is always a non-negative value.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown when the divisor is less than or equal to zero.

    Mod(double, double)

    Computes the remainder of a division operation, ensuring the result is always non-negative.

    Declaration
    public static double Mod(double value, double m)
    Parameters
    Type Name Description
    double value

    The dividend in the division operation.

    double m

    The divisor in the division operation. Must be greater than 0.

    Returns
    Type Description
    double

    The remainder of the division operation, always in the range [0, m).

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown when the divisor (m) is less than or equal to 0.

    Mod(int, int)

    Computes the true modulo (always in the range [0, m)) for the specified integer value and divisor.

    Declaration
    public static int Mod(int value, int m)
    Parameters
    Type Name Description
    int value

    The integer value to compute the modulo for.

    int m

    The divisor, which must be greater than 0.

    Returns
    Type Description
    int

    The result of the modulo operation, always in the range [0, m).

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown when m is less than or equal to 0.

    Mod(long, long)

    Calculates the modulus of a value, ensuring the result is always non-negative.

    Declaration
    public static long Mod(long value, long m)
    Parameters
    Type Name Description
    long value

    The value to calculate the modulus for.

    long m

    The modulus base, which must be greater than 0.

    Returns
    Type Description
    long

    The non-negative remainder of the division of the value by the modulus base.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown when the modulus base is less than or equal to 0.

    Mod(float, float)

    Computes the modulo of a value, ensuring the result is always within the range [0, m).

    Declaration
    public static float Mod(float value, float m)
    Parameters
    Type Name Description
    float value

    The value to compute the modulo for.

    float m

    The divisor, which must be greater than 0.

    Returns
    Type Description
    float

    The result of the modulo operation, always within the range [0, m).

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown if m is less than or equal to 0.

    NextPowerOfTwo(uint)

    Returns the next power of two greater than or equal to the specified value.

    Declaration
    public static uint NextPowerOfTwo(uint value)
    Parameters
    Type Name Description
    uint value

    The value to compute the next power of two for.

    Returns
    Type Description
    uint

    The next power of two greater than or equal to the specified value.

    Exceptions
    Type Condition
    OverflowException

    Thrown if the next power of two exceeds the maximum value of the type.

    NextPowerOfTwo(ulong)

    Calculates the next power of two greater than or equal to the specified value.

    Declaration
    public static ulong NextPowerOfTwo(ulong value)
    Parameters
    Type Name Description
    ulong value

    The value for which to calculate the next power of two.

    Returns
    Type Description
    ulong

    The next power of two greater than or equal to the specified value.

    Exceptions
    Type Condition
    OverflowException

    Thrown if the next power of two would exceed the maximum value of ulong.

    NormalizeAngleDeg180(float)

    Normalizes an angle in degrees to the range [-180, 180).

    Declaration
    public static float NormalizeAngleDeg180(float angle)
    Parameters
    Type Name Description
    float angle

    The angle in degrees to normalize.

    Returns
    Type Description
    float

    The normalized angle, which will be within the range [-180, 180).

    NormalizeAngleDeg360(float)

    Normalizes an angle in degrees to the range [0, 360).

    Declaration
    public static float NormalizeAngleDeg360(float angle)
    Parameters
    Type Name Description
    float angle

    The angle in degrees to normalize.

    Returns
    Type Description
    float

    The normalized angle within the range [0, 360).

    NormalizeAngleRad2Pi(float)

    Normalizes an angle in radians to the range [0, 2π).

    Declaration
    public static float NormalizeAngleRad2Pi(float angle)
    Parameters
    Type Name Description
    float angle

    The angle in radians to normalize.

    Returns
    Type Description
    float

    The normalized angle in the range [0, 2π).

    NormalizeAngleRadPi(float)

    Normalizes an angle in radians to the range [-π, π).

    Declaration
    public static float NormalizeAngleRadPi(float angle)
    Parameters
    Type Name Description
    float angle

    The angle in radians to normalize.

    Returns
    Type Description
    float

    The normalized angle within the range [-π, π).

    RadToDeg(float)

    Converts a value from radians to degrees.

    Declaration
    public static float RadToDeg(float radians)
    Parameters
    Type Name Description
    float radians

    The angle in radians to convert.

    Returns
    Type Description
    float

    The equivalent angle in degrees.

    Remap(double, double, double, double, double, bool)

    Remaps a value from one range to another, with an option to clamp the result to the target range.

    Declaration
    public static double Remap(double value, double inMin, double inMax, double outMin, double outMax, bool clamp = false)
    Parameters
    Type Name Description
    double value

    The value to remap.

    double inMin

    The lower bound of the input range.

    double inMax

    The upper bound of the input range.

    double outMin

    The lower bound of the output range.

    double outMax

    The upper bound of the output range.

    bool clamp

    Indicates whether the output value should be clamped to the output range.

    Returns
    Type Description
    double

    The remapped value, scaled to the range [outMin, outMax].

    Remap(float, float, float, float, float, bool)

    Remaps a specified value from one range to another.

    Declaration
    public static float Remap(float value, float inMin, float inMax, float outMin, float outMax, bool clamp = false)
    Parameters
    Type Name Description
    float value

    The value to be remapped.

    float inMin

    The lower bound of the input range.

    float inMax

    The upper bound of the input range.

    float outMin

    The lower bound of the output range.

    float outMax

    The upper bound of the output range.

    bool clamp

    Determines whether the interpolation factor should be clamped to the output range.

    Returns
    Type Description
    float

    The value remapped to the output range.

    Repeat(double, double)

    Repeats a value within the range [0, length). Effectively, it wraps the input value to stay within the specified range.

    Declaration
    public static double Repeat(double t, double length)
    Parameters
    Type Name Description
    double t

    The value to repeat.

    double length

    The length of the range. Must be greater than 0.

    Returns
    Type Description
    double

    The value wrapped within the range [0, length).

    Repeat(float, float)

    Loops a given value so that it is constrained within the range [0, length).

    Declaration
    public static float Repeat(float t, float length)
    Parameters
    Type Name Description
    float t

    The value to loop.

    float length

    The length of the range. Must be greater than 0.

    Returns
    Type Description
    float

    A value in the range [0, length).

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown if length is less than or equal to 0.

    RoundToDecimals(decimal, int)

    Rounds a decimal value to the specified number of decimal places.

    Declaration
    public static decimal RoundToDecimals(decimal value, int decimals)
    Parameters
    Type Name Description
    decimal value

    The decimal value to be rounded.

    int decimals

    The number of decimal places to round to. Must be greater than or equal to 0.

    Returns
    Type Description
    decimal

    The rounded decimal value.

    RoundToDecimals(double, int)

    Rounds a double-precision floating-point value to the specified number of fractional decimal places.

    Declaration
    public static double RoundToDecimals(double value, int decimals)
    Parameters
    Type Name Description
    double value

    The double value to round.

    int decimals

    The number of decimal places to round to. Must be 0 or greater.

    Returns
    Type Description
    double

    The rounded double value, rounded to the specified number of decimal places.

    RoundToDecimals(float, int)

    Rounds the specified value to the given number of decimal places using midpoint rounding away from zero.

    Declaration
    public static float RoundToDecimals(float value, int decimals)
    Parameters
    Type Name Description
    float value

    The float value to round.

    int decimals

    The number of decimal places to round to. Must be greater than or equal to zero.

    Returns
    Type Description
    float

    The rounded float value.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown when decimals is negative.

    RoundToInt(double)

    Rounds a double value to the nearest integer, with midpoint values rounding away from zero.

    Declaration
    public static int RoundToInt(double value)
    Parameters
    Type Name Description
    double value

    The double value to be rounded.

    Returns
    Type Description
    int

    The rounded integer value.

    Exceptions
    Type Condition
    OverflowException

    Thrown if the rounded value exceeds the range of the int type.

    RoundToInt(float)

    Rounds the specified floating-point value to the nearest integer, with midpoint values rounded away from zero.

    Declaration
    public static int RoundToInt(float value)
    Parameters
    Type Name Description
    float value

    The floating-point value to round.

    Returns
    Type Description
    int

    The rounded integer value.

    SafeDivide(decimal, decimal, decimal)

    Safely divides a numerator by a denominator, returning a fallback value if the denominator is zero.

    Declaration
    public static decimal SafeDivide(decimal numerator, decimal denominator, decimal fallback = 0)
    Parameters
    Type Name Description
    decimal numerator

    The value to be divided.

    decimal denominator

    The value to divide the numerator by.

    decimal fallback

    The value to return if the denominator is zero.

    Returns
    Type Description
    decimal

    The result of the division if the denominator is non-zero; otherwise, the fallback value.

    SafeDivide(double, double, double)

    Safely divides a numerator by a denominator, returning a fallback value if the denominator is zero.

    Declaration
    public static double SafeDivide(double numerator, double denominator, double fallback = 0)
    Parameters
    Type Name Description
    double numerator

    The value to be divided.

    double denominator

    The value by which to divide the numerator.

    double fallback

    The value to return if the denominator is zero. Defaults to 0.

    Returns
    Type Description
    double

    The result of the division if the denominator is not zero; otherwise, the fallback value.

    SafeDivide(float, float, float)

    Divides the specified numerator by the specified denominator. Returns the fallback value if the denominator is zero.

    Declaration
    public static float SafeDivide(float numerator, float denominator, float fallback = 0)
    Parameters
    Type Name Description
    float numerator

    The value to be divided.

    float denominator

    The value by which the numerator is divided.

    float fallback

    The value to return if the denominator is zero. Defaults to 0.

    Returns
    Type Description
    float

    The result of the division if the denominator is not zero, otherwise the fallback value.

    SignNonZero(double, double)

    Returns -1 if the specified double value is strictly less than -epsilon, or +1 for any value greater than or equal to -epsilon. Values in the near-zero tolerance band are treated as positive.

    Declaration
    public static int SignNonZero(double value, double epsilon = 1E-12)
    Parameters
    Type Name Description
    double value

    The double-precision value to evaluate.

    double epsilon

    The tolerance that defines the zero-band. Must be non-negative. Defaults to EPSILON_D.

    Returns
    Type Description
    int

    -1 if value < -epsilon; +1 otherwise.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown if epsilon is negative.

    SignNonZero(int)

    Returns -1 if the specified integer value is negative, or +1 if the value is zero or positive. Unlike Math.Sign(int), this method never returns 0, making it safe to use as a divisor or direction multiplier without an additional zero-check.

    Declaration
    public static int SignNonZero(int value)
    Parameters
    Type Name Description
    int value

    The integer value to evaluate.

    Returns
    Type Description
    int

    -1 if value is negative; +1 otherwise.

    SignNonZero(long)

    Returns -1 if the specified 64-bit integer value is negative, or +1 if the value is zero or positive. Unlike Math.Sign(long), this method never returns 0.

    Declaration
    public static int SignNonZero(long value)
    Parameters
    Type Name Description
    long value

    The 64-bit integer value to evaluate.

    Returns
    Type Description
    int

    -1 if value is negative; +1 otherwise.

    SignNonZero(float, float)

    Returns -1 if the specified float value is strictly less than -epsilon, or +1 for any value greater than or equal to -epsilon (including zero and near-zero values within the tolerance band). This ensures zero and values within the epsilon band are always treated as positive, making the result safe to use as a non-zero direction multiplier.

    Declaration
    public static int SignNonZero(float value, float epsilon = 1E-06)
    Parameters
    Type Name Description
    float value

    The float value to evaluate.

    float epsilon

    The tolerance that defines the zero-band. Values in the range [-epsilon, +epsilon] are treated as positive. Must be non-negative. Defaults to EPSILON.

    Returns
    Type Description
    int

    -1 if value < -epsilon; +1 otherwise.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown if epsilon is negative.

    Snap(decimal, decimal)

    Snaps a value to the nearest multiple of the specified step.

    Declaration
    public static decimal Snap(decimal value, decimal step)
    Parameters
    Type Name Description
    decimal value

    The value to be snapped.

    decimal step

    The step size to which the value should be snapped. Must be greater than 0.

    Returns
    Type Description
    decimal

    The value snapped to the nearest multiple of the step.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown if step is less than or equal to 0.

    Snap(double, double)

    Rounds the given value to the nearest multiple of the specified step.

    Declaration
    public static double Snap(double value, double step)
    Parameters
    Type Name Description
    double value

    The value to round.

    double step

    The step size to which the value will be rounded. Must be greater than 0.

    Returns
    Type Description
    double

    The value rounded to the nearest multiple of the specified step.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown if step is less than or equal to 0.

    Snap(float, float)

    Rounds the specified value to the nearest multiple of the specified step (midpoint rounds away from zero).

    Declaration
    public static float Snap(float value, float step)
    Parameters
    Type Name Description
    float value

    The value to be rounded.

    float step

    The step size to which the value will be rounded. Must be greater than 0.

    Returns
    Type Description
    float

    The rounded value, as a multiple of the specified step.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown if the step is less than or equal to 0.

    Sqr(decimal)

    Returns the square of the specified decimal value (value * value).

    Declaration
    public static decimal Sqr(decimal value)
    Parameters
    Type Name Description
    decimal value

    The decimal value to square. May be negative; the result is always non-negative.

    Returns
    Type Description
    decimal

    value * value.

    Sqr(double)

    Returns the square of the specified double value (value * value).

    Declaration
    public static double Sqr(double value)
    Parameters
    Type Name Description
    double value

    The double-precision value to square. May be negative; the result is always non-negative for finite inputs.

    Returns
    Type Description
    double

    value * value.

    Sqr(int)

    Returns the square of the specified int value (value * value). Useful as a concise alternative to Math.Pow(value, 2) without a cast or allocation.

    Declaration
    public static int Sqr(int value)
    Parameters
    Type Name Description
    int value

    The integer value to square. May be negative; the result is always non-negative.

    Returns
    Type Description
    int

    value * value. Note that overflow is not checked; very large inputs will wrap silently.

    Sqr(long)

    Returns the square of the specified long value (value * value).

    Declaration
    public static long Sqr(long value)
    Parameters
    Type Name Description
    long value

    The 64-bit integer value to square. May be negative; the result is always non-negative.

    Returns
    Type Description
    long

    value * value. Note that overflow is not checked; very large inputs will wrap silently.

    Sqr(float)

    Returns the square of the specified float value (value * value).

    Declaration
    public static float Sqr(float value)
    Parameters
    Type Name Description
    float value

    The float value to square. May be negative; the result is always non-negative for finite inputs.

    Returns
    Type Description
    float

    value * value.

    Wrap(int, int, int)

    Wraps a value into the half-open interval defined by the specified minimum (inclusive) and maximum (exclusive) bounds.

    Declaration
    public static int Wrap(int value, int minInclusive, int maxExclusive)
    Parameters
    Type Name Description
    int value

    The value to be wrapped.

    int minInclusive

    The inclusive lower bound of the interval.

    int maxExclusive

    The exclusive upper bound of the interval.

    Returns
    Type Description
    int

    The wrapped value, constrained within the interval [minInclusive, maxExclusive).

    Exceptions
    Type Condition
    ArgumentException

    Thrown if maxExclusive is less than or equal to minInclusive.

    Wrap(long, long, long)

    Wraps a given value such that it falls within the inclusive lower bound and exclusive upper bound, cycling back to the lower bound if it exceeds the upper bound.

    Declaration
    public static long Wrap(long value, long minInclusive, long maxExclusive)
    Parameters
    Type Name Description
    long value

    The value to wrap.

    long minInclusive

    The inclusive lower bound of the range.

    long maxExclusive

    The exclusive upper bound of the range.

    Returns
    Type Description
    long

    The wrapped value within the range [minInclusive, maxExclusive).

    Wrap(uint, uint, uint)

    Wraps a value to fit within a specified range, ensuring that the resulting value lies within [minInclusive, maxExclusive).

    Declaration
    public static uint Wrap(uint value, uint minInclusive, uint maxExclusive)
    Parameters
    Type Name Description
    uint value

    The value to wrap.

    uint minInclusive

    The inclusive lower bound of the range.

    uint maxExclusive

    The exclusive upper bound of the range. Must be greater than minInclusive.

    Returns
    Type Description
    uint

    The wrapped value, guaranteed to be within the range [minInclusive, maxExclusive).

    Wrap(ulong, ulong, ulong)

    Wraps a value such that it falls within the specified range [minInclusive, maxExclusive). If the value is outside the range, it is adjusted to "wrap around" within the range.

    Declaration
    public static ulong Wrap(ulong value, ulong minInclusive, ulong maxExclusive)
    Parameters
    Type Name Description
    ulong value

    The value to be wrapped.

    ulong minInclusive

    The inclusive lower bound of the range.

    ulong maxExclusive

    The exclusive upper bound of the range.

    Returns
    Type Description
    ulong

    The wrapped value, adjusted to lie within the range [minInclusive, maxExclusive).

    Exceptions
    Type Condition
    ArgumentException

    Thrown when maxExclusive is less than or equal to minInclusive, or when the range is zero.

    In this article
    Back to top Scylla Framework - Core Module API Documentation