-
Notifications
You must be signed in to change notification settings - Fork 0
/
Int+.swift
42 lines (33 loc) · 1.13 KB
/
Int+.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//
// File.swift
//
//
// Created by Dhiogo Brustolin on 19.05.24.
//
import Foundation
public extension Int {
static func / <FLOATING : FloatingPoint>(lhs: Int, rhs: FLOATING) -> FLOATING {
return FLOATING(lhs) / rhs
}
static func * <FLOATING : FloatingPoint>(lhs: Int, rhs: FLOATING) -> FLOATING {
return FLOATING(lhs) * rhs
}
static func + <FLOATING : FloatingPoint>(lhs: Int, rhs: FLOATING) -> FLOATING {
return FLOATING(lhs) + rhs
}
static func - <FLOATING : FloatingPoint>(lhs: Int, rhs: FLOATING) -> FLOATING {
return FLOATING(lhs) - rhs
}
static func / <FLOATING : FloatingPoint>(lhs: FLOATING, rhs: Int) -> FLOATING {
return lhs / FLOATING(rhs)
}
static func * <FLOATING : FloatingPoint>(lhs: FLOATING, rhs: Int) -> FLOATING {
return lhs * FLOATING(rhs)
}
static func + <FLOATING : FloatingPoint>(lhs: FLOATING, rhs: Int) -> FLOATING {
return lhs + FLOATING(rhs)
}
static func - <FLOATING : FloatingPoint>(lhs: FLOATING, rhs: Int) -> FLOATING {
return lhs - FLOATING(rhs)
}
}