Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 600 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Short to var - type conversion #477324
06/15/19 13:59
06/15/19 13:59
Joined: Jul 2017
Posts: 784
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 784
Why would :
Code
short t;

var s = pow( (var)t, 2.5);
generate a Syntax error: Wrong type CONV:SHORT::DOUBLE

?

Re: Short to var - type conversion [Re: Zheka] #477325
06/15/19 15:57
06/15/19 15:57
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline
Senior Member
Grat  Offline
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
maybe not directly from the short

try this:
Code
var s = pow( (t*1.0), 2.5);
var s = pow( (var)(int)t, 2.5);

Re: Short to var - type conversion [Re: Zheka] #477326
06/15/19 16:25
06/15/19 16:25
Joined: Jul 2017
Posts: 784
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 784
Thank you, but the question is not how to make it work.

pow(int,var) works as is, without any typecasting.

But why would pow( (var)short, var) not work?

Re: Short to var - type conversion [Re: Zheka] #477327
06/15/19 17:29
06/15/19 17:29
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Because Lite C is not C. grin

Re: Short to var - type conversion [Re: Zheka] #477334
06/16/19 13:34
06/16/19 13:34
Joined: Jul 2017
Posts: 784
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 784
Yeah,seems to be so as var z=(var) t would not work either.

Re: Short to var - type conversion [Re: Zheka] #477338
06/17/19 05:38
06/17/19 05:38
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline
Senior Member
Grat  Offline
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
In the Lite C is no work typecasting from SHORT to VAR directly


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1