Hello BP, to give similarity to the Python syntax, please overload the INTEGER command
integer() as a function synonym of expr() and iPart() cmd
example
integer("42") [enter] 42
integer("1.25") [enter] 1
I note that the float command does operate in this way =)
float("3.14") [enter] 3.14
float(10) [enter] 10.0
INTEGER() function command
Modérateur : xcasadmin
-
- Messages : 561
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: INTEGER() function command
integer does not exist in Python, it's int, and it's already in Xcas if you select Python syntax compatibility.
-
- Messages : 561
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: INTEGER() function command
Ok, but that the integer() command is available in xcas is also a good idea.
In addition, in some cases it is required to extract only the entire part of a number that is enclosed as a string.
integer("1.25") [enter] 1
About expr() cmd in the case of expr(5) return 5 and not expr(5)
In addition, in some cases it is required to extract only the entire part of a number that is enclosed as a string.
integer("1.25") [enter] 1
About expr() cmd in the case of expr(5) return 5 and not expr(5)
Re: INTEGER() function command
int does that in Python mode. Please check before asking.