| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Please mark this as "Ready for review" when ready. If you have any doubt, please ask. |
Sorry, something went wrong.
|
@Shaikh-Ubaid I do have some doubts. They are related to throwing errors.
My chief concern is that while both of these can be done while casting, it is not clean, and probably not supported there too. |
Sorry, something went wrong.
|
Sharing my thoughts on this:
I believe the above approach solves all your concerns. |
Sorry, something went wrong.
I think there is a catch. @certik said that int() will mean an arbitrary precision integer in future for LPython. Considering the case of a hexadecimal or an octal number, the result of something like i32(int("0x101100", 16))" will cause an error as the value is too large to fit in an i32. Supporting your idea and building upon it, I think we need to not just cast a string to an integer, but convert it. Please let me know your thoughts on this. :) But again, we can surely build on top of the support we have for int() now. Let's work out a plan for that. |
Sorry, something went wrong.
I think the type int would mean an arbitrary precision integer. For example, x: int. I think for now it is safe to use int() for string to int conversion.
Let's just focus on normal/decimal (base 10) integers for now. Once that is robustly supported, we can try supporting integers of other bases. |
Sorry, something went wrong.
Sure, go ahead and make a plan. Figure out what is left to be supported for int() or what fails and you can work on fixing it. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Resolves #2554
Implement basic string to integer conversion using CharacterToInteger casting, which I believe is a part of LFortran, but was not implemented here in LPython.
Working
ASR
Tasks