Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Trading Journey
by howardR. 04/24/24 20:04
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, EternallyCurious, Petra, 1 invisible), 764 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 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