Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,119 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
replace var with float and support var as float typedef #337832
08/13/10 20:02
08/13/10 20:02
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Hi JCL,

can you please consider to abandon the var type soon? I don't think it is a big deal! Just replace everywhere var with float and create a backward compatibility through

typedef float var;

You can also replace all integer values with the int type (like panel coordinates) and savely use it since you automatically convert floats to int, right?

I think this is NOT such a big deal, isn't it?

Thanks in advance,
-Christian

Re: replace var with float and support var as float typedef [Re: HeelX] #337839
08/13/10 21:10
08/13/10 21:10
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
Seconded! Most of my headaches in anything motion/physics related comes from the fact that VECTORs are composed of vars.

Jibb


Formerly known as JulzMighty.
I made KarBOOM!
Re: replace var with float and support var as float typedef [Re: JibbSmart] #337842
08/13/10 21:33
08/13/10 21:33
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
Dunno if this is so easy with backwards compatibility (because of precision and stuff, the "advantage" of vars is that is can exactly store numbers like 1000000.5), but otherwise I'd agree, too.

But, replacing panel coordinates and sizes with ints is kindof tricky, because if you set it to 0, it has the size of its bitmap, while it vanishes if you set it to 0.1. And I think there are some other issues like that with vars that normally could be ints...

Re: replace var with float and support var as float typedef [Re: Lukas] #337847
08/13/10 21:53
08/13/10 21:53
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Thirded (even a word? lol)

I'd like lite-c to just stick with int and float instead of var.

Re: replace var with float and support var as float typedef [Re: DJBMASTER] #337848
08/13/10 21:55
08/13/10 21:55
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
fourthed(im sure thats not a word :d)

i always use floats my self but as others it would be great if predefined structs also use float.

Last edited by Quadraxas; 08/13/10 21:55.

3333333333
Re: replace var with float and support var as float typedef [Re: Quad] #337850
08/13/10 22:06
08/13/10 22:06
Joined: Jul 2004
Posts: 40
UK
M
Macro Offline
Newbie
Macro  Offline
Newbie
M

Joined: Jul 2004
Posts: 40
UK
Fifthed.

I prefer to work with standard c data types where I can.

MACRO

Re: replace var with float and support var as float typedef [Re: Macro] #337852
08/13/10 22:09
08/13/10 22:09
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
What's so bad about var?


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: replace var with float and support var as float typedef [Re: Macro] #337854
08/13/10 22:10
08/13/10 22:10
Joined: Sep 2002
Posts: 1,604
Deutschland
ChrisB Offline
Serious User
ChrisB  Offline
Serious User

Joined: Sep 2002
Posts: 1,604
Deutschland
I support this request too. My religion forbids the use of fixed point variables and I dont want to go to hell just for using acknex.


www.Swollen-Eyeballs.org
ICQ:169213431
#3dgs@quakenet
Re: replace var with float and support var as float typedef [Re: Superku] #337856
08/13/10 22:15
08/13/10 22:15
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
Originally Posted By: Superku
What's so bad about var?

This might give you some idea:
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=294389&page=2

What bugs me personally the most, is that I can't even exactly store a value of e.g. 0.1, because it get's converted to 102/1024 = 0.099609375.

Re: replace var with float and support var as float typedef [Re: Superku] #337858
08/13/10 22:29
08/13/10 22:29
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
Originally Posted By: Superku
What's so bad about var?
If you've ever worked with Quaternions, you lose a horrendous amount of precision by using vars. This is because of all the trigonometry that gets used. The vec_ functions would be so much more useful if VECTORs were composed of floats. It's not the end of the world to write my own versions that use floats, but it's annoying.

Jibb


Formerly known as JulzMighty.
I made KarBOOM!
Page 1 of 2 1 2

Moderated by  aztec, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1