Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for floorDiv operator (//) #486

Merged

Conversation

linsword13
Copy link
Collaborator

This is useful when the output is expected to be an integer (which gets fed into int() and causes error when the input is say '44.0'.) The same can be achieved using floor, but the // operator is a bit more convenient.

Example usage:

variables:
  # versus '{floor({cores_per_node}/{n_threads})}'
  processes_per_node: '{cores_per_node}//{n_threads}'

This is useful when the output is expected to be an integer (which gets
fed into `int()` and causes error when the input is say '44.0'.) The
same can be achieved using `floor`, but the `//` operator is a bit more
convenient.

Example usage:

```yaml
variables:
  # versus '{floor({cores_per_node}/{n_threads})}'
  processes_per_node: '{cores_per_node}//{n_threads}'
```
@douglasjacobsen douglasjacobsen merged commit 606d827 into GoogleCloudPlatform:develop May 14, 2024
5 checks passed
@douglasjacobsen douglasjacobsen self-assigned this May 14, 2024
@douglasjacobsen douglasjacobsen added the enhancement New feature or request label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants