Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

279 B
Raw Blame
import Foundation

/// Truncate like Int(Double), but refuse non-finite/out-of-range values so malformed requests cannot crash the agent.
public func boundedInteger<T: BinaryInteger>(_ value: Double, as type: T.Type = T.self) -> T? {
    T(exactly: value.rounded(.towardZero))
}