algorithmic modeling for Rhino
Hi All,
I'm often converting numerical strings (strings limited to the characters 1234567890) to integers for IDing and scheduling things. However, I've recently run into an issue where numerical strings exceeding a certain text length will no longer convert. Is there a workaround for this in Grasshopper or Python? Tips appreciated. Image below.
(The red component error text reads "1. Data conversion failed from Text to Integer")
Thanks,
B
Tags:
I found the answer - basically my lack of computer science knowledge...
Yeah integers have a limited range. They cannot represent numbers bigger than 2,147,483,647
Grasshopper uses 32-bit integers (details on the type here).
If you're willing to write your own code then you can switch to 64-bit integers, which have a much bigger range, but it too is limited. Ultimately there's a BigInteger type which is not limited (except in the ridiculous sense that eventually you will run out of memory to store the number). However neither of these types are supported by Grasshopper, so they can only exist within custom code.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by