---
title: "floorModulo(_:_:name:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Instance Method
path: "metalperformanceshadersgraph/mpsgraph/floormodulo(_:_:name:)"
---

# floorModulo(_:_:name:)

Returns the remainder of floor divison between the primary and secondary tensor.

## Declaration

```swift
func floorModulo(_ primaryTensor: MPSGraphTensor, _ secondaryTensor: MPSGraphTensor, name: String?) -> MPSGraphTensor
```

## Parameters

- `primaryTensor`: The LHS tensor of the binary Op.
- `secondaryTensor`: The RHS tensor of the binary Op.
- `name`: An optional string which serves as an identifier for the operation.

## Return Value

Return Value A valid MPSGraphTensor object containing the elementwise result of the applied operation.

## Discussion

Discussion Creates a floorModulo operation and returns the result tensor, it supports broadcasting as well, returns 0 if divisor is 0. resultTensor = primaryTensor - (floor(primaryTensor / secondaryTensor) * secondaryTensor)
