Dreamora. No, it shouldn't work. When you cast a variable like int(somefloat#), it's not the variable being converted, but rather the value inside the variable. You can't create a reference to that value since the value isn't stored anywhere.
Now if you were to do
That would work because now the converted value is being stored somewhere that can be referenced.
Some languages, such as c++, do allow you to cast pointers of one type to pointers of another. For instance
However, if the function DoSomething writes to the area pointed to, it will be as an Int and not a Float. The results will be corrupted. Typically type pointers will be cast when a function deals with the raw data and not with actual values.
Now if you were to do
local SomeInt:Int = Int(SomeFloat) Local SomePtr:Int Ptr = Varptr SomeInt
That would work because now the converted value is being stored somewhere that can be referenced.
Some languages, such as c++, do allow you to cast pointers of one type to pointers of another. For instance
Float *Float_ptr; DoSomething((int *)Float_ptr);
However, if the function DoSomething writes to the area pointed to, it will be as an Int and not a Float. The results will be corrupted. Typically type pointers will be cast when a function deals with the raw data and not with actual values.