I was trying to use the "int" symbol as a floor function (as mentioned in the used guide).
I tried to use the function like, for example, "x=int(1.5)" to return "x=1" but I got the following message from the Expression Editor:
In function ‘cs_meg_boundary_function’: expected expression before ‘int’'
What is the mistake?
Is it maybe only usable as an "int" type definition like "int x = 1"? (but in the guide it is listed like a function)
Have you got any working example of the correct usage of "int" as a function?
Thank you in advance.
Lorenzo
User law - "int" symbol
Forum rules
Please read the forum usage recommendations before posting.
Please read the forum usage recommendations before posting.
-
- Posts: 4207
- Joined: Mon Feb 20, 2012 3:25 pm
Re: User law - "int" symbol
Hello,
If the user guide mentions int(), this is an error and we need to update this....
The code snippets defined in the GUI formulas are inserted into C code, so if you want to conver a variable x to an integer, you can use the C casting method:
x =(int)1.5;
Best regards,
Yvan
If the user guide mentions int(), this is an error and we need to update this....
The code snippets defined in the GUI formulas are inserted into C code, so if you want to conver a variable x to an integer, you can use the C casting method:
x =(int)1.5;
Best regards,
Yvan