How to convert "-3" to an integer ?
Answered
I have some input boxes that are connected to a text variable. And then I convert the input to an integer by using the command; FromBase[ >>String<<, 10 ].
There is no problem as long as the string holds an integer >= 0.When the integer is negative, the command returns undefined. For example if I write:
FromBase[ "-3", 10 ]
How can I get GG to return a negative integer as in the example above ?
https://wiki.geogebra.org/e...
I always work with an earlier defined number n, using following script in the input box of a text variable:
SetValue(n, %0). This command assigns the typed text to the number n, no matter if it's positive or not.
chris
https://wiki.geogebra.org/e...
Comments have been locked on this page!