Documentation Language: Swift

Function

floor(_:)

Returns the largest integer less than or equal to the value (OCL Real.floor()).

func floor(_ value: any EcoreValue) throws -> EInt

Parameters

value

The Real value to compute floor for

Return Value

The floor as an Integer

Discussion

Computes the floor function as defined in OCL specification. Only accepts Real (Double) values as per OCL standard.

Examples

let result1 = try floor(3.7 as EDouble)  // Result: 3
let result2 = try floor(-2.3 as EDouble) // Result: -3