Unity Pro XL - Problems w/ INTS and REALS math

FNC

Member
Join Date
May 2010
Location
NJ
Posts
84
I need to do a calculation and am having problem.

INT1 := 2/3 * INT2 + 100

The real math is a bit more complicated but that is it essentially. Since 2/3 * INT2 is not an integer the software ignores it and says INT1 is 100.

I guess I'd like to assign it to a real then round up and assign it to an integer. Is this feasible?

Unity does not like any math involving integers and reals.
 
Unity does not like any math involving integers and reals.
Unity enforces strict type casting, that is you can't mix types in mathematical operations. It does however have every type conversion function built in. Use Int_to_Real or Real_To_Int where required

Int1 = Real_To_Int( 2/3 * Int_To_Real(Int2) + 100.0)
 

Similar Topics

Deal all, I am trying to configure the NOC 780000 via Unity Pro XL. My scope is to communicate with a flow computer via modbus TCP/IP. In NOC...
Replies
1
Views
1,693
Hello, I am using Unity pro V15. I have Quantum CPU 671 and Ethernet NOE 77101 configured. I have configured IO scanning on NOE. I have attached...
Replies
5
Views
175
HELLO MY FRİENDS ı have problem. ı tought you can solved thıs problem for me. First of all When I checked all the cable connections of the...
Replies
0
Views
401
Hi All, I haven't installed Unity Pro in years and needed to install it recently. I initially tried installing Version 11.1 and the whole...
Replies
3
Views
709
Hello i want to implement a Read_var / Write_var functions to communicate with a modbus tcp device at the moment i use the unity simulator at the...
Replies
4
Views
1,922
Back
Top Bottom