Register
Log In
Forums
Starting with Zorro
Short to var - type conversion
Forums
Calendar
Active Threads
Search
Forum Help
Gamestudio Links
► Features
► Download
► Online Manual
► Online Tutorial
► Free Resources
► F.A.Q.
Zorro Links
► Download
► Online Manual
► Online Tutorial
► Blog
► Support
► What's New?
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
♪♫♪ [For hire] VOLKOVSTUDIO - Music, SFX, Voice over, implementa
by Volkovstudio. 04/16/24 09:54
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
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
OP
User
Zheka
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
Senior Member
Grat
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
OP
User
Zheka
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
Serious User
AndrewAMD
Serious User
Joined:
Feb 2017
Posts: 1,725
Chicago
Because Lite C is not C.
www.vitaltrades.com
-
andrew@vitaltrades.com
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
OP
User
Zheka
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
Senior Member
Grat
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
Hop To
Gamestudio ------
Starting with Gamestudio
Atari lite-C
Editors & Templates
A8 Engine
Shaders
Third Party Tools
Acknex Users Magazine
The Past
The Future
Zorro ------
Starting with Zorro
Educational
Automated Trading
Zorro Scripts
The Z Systems
Zorro and the Brokers
Zorro Future
Feedback ------
Bug Hunt
Blame the Manual
Ask the Developers
Updates & Announcements
Rants
Game Creation ------
Game Design & Business
Jobs Wanted
Jobs Offered
User Resources
Projects
Showcase
Beyond Games & Money ------
Hilbert's Hotel
Morbius' Virtual Answering Machine
Print Thread
Switch to Threaded Mode
5
Excellent
4
Good
3
Average
2
Bad
1
Terrible
View Profile
Send Private Message
Follow User
Show Forum Posts
View Profile
Send Private Message
Follow User
Show Forum Posts
View Profile
Send Private Message
Follow User
Show Forum Posts
View Profile
Send Private Message
View Homepage
Follow User
Show Forum Posts
View Profile
Send Private Message
Follow User
Show Forum Posts
View Profile
Send Private Message
Follow User
Show Forum Posts
Default Style
gamestudio
UBBT77
UBBT77 - Dark2
Forum Rules
·
Mark All Read
·
Powered by UBB.threads™ PHP Forum Software 7.7.1