Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology
Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered
You are not logged in.
Pages: 1
I've been digging for like 5 hours with variables. Found the operator.But it's with one variable. The second one cannot be multiplied, divided, or raised to the root in any way.
How to do mathematical operations with variables?
Offline
Hello,
you can do maths with the operator plugIT for example.
or using the "[code\]" mark in link parameter (remove the \ at the end of code mark this is because of the forum BBcode)
for that keep in mind that parameters are all string so you have ton use atoi or atof and then set the result back to string using itoa or atof.
multiply 2 parameter value based on int, the values must be interger only
[code\]
itoa ($1 * $2)
[/code\]the same but forcing the parameter to integer to prevent error
[code\]
itoa ((atoi "$1") * (atoi "$2"))
[/code\]again with float
[code\]
ftoa ((atof "$1") *. (atof "$2"))
[/code\]
Offline
Hello,
you can do maths with the operator plugIT for example.
or using the "[code\]" mark in link parameter (remove the \ at the end of code mark this is because of the forum BBcode)
for that keep in mind that parameters are all string so you have ton use atoi or atof and then set the result back to string using itoa or atof.multiply 2 parameter value based on int, the values must be interger only
[code\]
itoa ($1 * $2)
[/code\]the same but forcing the parameter to integer to prevent error
[code\]
itoa ((atoi "$1") * (atoi "$2"))
[/code\]again with float
[code\]
ftoa ((atof "$1") *. (atof "$2"))
[/code\]
now it is very important to understand how mathematics works with several variables. For some reason, I don't see the files with the project names in my projects folder.I see them in the program. How to send?
Offline
https://disk.yandex.ru/d/qHHAZB6aTe6LgQ
https://disk.yandex.ru/d/RWWam3P37i8eGw
Last edited by vinurd (30-Nov-2021 14:10:15)
Offline
To send a program export to PKOS (OpenSpace3D package)
The file should be in your my documents/OpenSpace3D/projects... folder
In last version the demos and examples have been transferred in the program folder to avoid multiplication of files for multiple account computers.
If you have modified the ums.ini file to change the default partition maybe this is your issue
Offline
Offline
Pages: 1