-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add convert(Float,_), convert(Int,_), convert(Uint,_) methods.
This moves the burden to the more general convert function from the more ad-hoc float(), int() and uint() functions. Also added the signed(x) function which converts any integer to the signed type of the same size. Previously int(x) would make unsigned integers into signed ones of a size that could safely fit them (8->16->32->64), but now int(x) leaves all subtypes of Int as-is, which makes more sense anyway.
- Loading branch information
1 parent
f66e816
commit 6008d6c
Showing
2 changed files
with
33 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters