Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type IntLikeForCount = int|int8|int16|int32|char|bool|uint8|uint16|enum
- iterator countupn*[S, T](a: S, b: T, step = 1): T {.inline.} =
- when T is IntLikeForCount:
- var res = int(a)
- while res <= int(b):
- yield T(res)
- inc(res)
- else:
- var res: T = T(a)
- while res <= b:
- yield res
- inc(res)
- converter fToi(x:float):int = x.int
- #var t:int = 4.3
- for _ in countupn( 1 , 4.3 ):
- echo "Test"
Advertisement
Add Comment
Please, Sign In to add comment