added missing constants

This commit is contained in:
2023-10-07 09:00:05 +08:00
parent b8f704285c
commit 88574a8b5b

39
src/mmath/constant.nim Normal file
View File

@@ -0,0 +1,39 @@
proc one*[T : int64](_: type[T]) : T = 1.T
proc zero*[T : int64](_: type[T]) : T = 0.T
proc one*[T : uint64](_: type[T]) : T = 1.T
proc zero*[T : uint64](_: type[T]) : T = 0.T
proc one*[T : int](_: type[T]) : T = 1.T
proc zero*[T : int](_: type[T]) : T = 0.T
proc one*[T : uint](_: type[T]) : T = 1.T
proc zero*[T : uint](_: type[T]) : T = 0.T
proc one*[T : int16](_: type[T]) : T = 1.T
proc zero*[T : int16](_: type[T]) : T = 0.T
proc one*[T : uint16](_: type[T]) : T = 1.T
proc zero*[T : uint16](_: type[T]) : T = 0.T
proc one*[T : int8](_: type[T]) : T = 1.T
proc zero*[T : int8](_: type[T]) : T = 0.T
proc one*[T : uint8](_: type[T]) : T = 1.T
proc zero*[T : uint8](_: type[T]) : T = 0.T
proc one*[T : float32](_: type[T]) : T = 1.T
proc zero*[T : float32](_: type[T]) : T = 0.T
proc one*[T : float64](_: type[T]) : T = 1.T
proc zero*[T : float64](_: type[T]) : T = 0.T