Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

879792 Posts in 33006 Topics- by 24379 Members - Latest Member: alisiahl87

May 25, 2013, 12:39:04 AM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)Int or Float
Poll
Question: Search your feelings - you know you have a bias for one of them:
Float - 18 (16.5%)
Int - 58 (53.2%)
Nope, totally, completely unbiased - 33 (30.3%)
Total Voters: 105

Pages: 1 ... 8 9 [10] 11 12
Print
Author Topic: Int or Float  (Read 6333 times)
Paul Eres
Level 10
*****


Also known as RinkuHero.

RinkuHero
View Profile WWW Email
« Reply #135 on: February 12, 2012, 06:41:57 PM »

i just thought of another good example that's literally under your fingers: qwerty vs dvorak. i'm sure many of you know the story, but here it is for those who don't: back when people used typewriters, if you typed too fast the punchers would get stuck together, so they designed the keyboard to make people type *slower*, and to make it so that they have to alternate left and right hand keys more often, so that the left and right punchers wouldn't get tangled.

so the keyboard layout 99.9+% of people use was designed so that letters that are commonly typed as pairs are as far apart from one another as possible, to avoid the tangled puncher business, *even though* it doesn't work like that anymore

this system was kept for computers, even though computer keyboards work nothing like typewriters. someone created a superior keyboard layout called dvorak which allows people to type much faster and use less energy doing so, but keyboards *still* use qwerty, not dvorak, because of tradition

if nix and tommo were right, wouldn't the industry have, at some point, switched to dvorak, or something similar? after all, hundreds of smart people and an entire industry can't be wrong about qwerty, no? surely it's not done *just because* of tradition?
Logged

Nix
Level 10
*****



View Profile
« Reply #136 on: February 12, 2012, 07:12:27 PM »

i just thought of another good example that's literally under your fingers: qwerty vs dvorak.

The difference is that a ternary computer would be far superior with many uses in industry. A company that produced ternary computers at the same price of binary computers would make tons of money. Dvorak is a matter of user preference and a company that produced dvorak keyboards may not do very well if no one wanted to use them.

edit: dammit
Logged
Average Software
Level 10
*****

Fleeing all W'rkncacnter


View Profile WWW Email
« Reply #137 on: February 12, 2012, 08:17:14 PM »

also, superior technologies don't always win out, sometimes inferior ones can win due to other factors. one classic example of this is VHS vs 8-track,

You may want to check your facts before using them to support your argument.  8-track has nothing to do with VHS.  8-track was the predecessor to the audio cassette tape.  VHS competed with Sony's Betamax format.
Logged

Franchise - The restaurant wars begin!

What would John Carmack do?
Will Vale
Level 4
****


will@secondintention.com
View Profile WWW Email
« Reply #138 on: February 12, 2012, 10:19:14 PM »

The point that Tommo was making is a good one:  Whatever radix you use for your representation (binary, ternary, decimal) you need to have a way to fit arbitrary numbers with infinite representations into finite spaces. This isn't just pi and root-2, there are uncountable numbers of irrationals in between the countable rationals and integers:

http://en.wikipedia.org/wiki/Cantor%27s_first_uncountability_proof

IEEE floats do a remarkably good job of this (fitting into finite spaces) and have lots of fabulous characteristics which allow them to interoperate with integer registers and integer instructions in a sane way.

It's worth looking at the IEEE 754 standard in detail to see how zeroes and comparisons work, for example, to see how clever all this stuff is.

so they designed the keyboard to make people type *slower*,

According to Wikipedia (so make of that what you will!) the QWERTY layout was designed to place frequently-used pairs of letters far apart so that the likelihood of jamming was reduced (neighbouring keys pressed together or in quick succession could jam). It wasn't supposed to slow people down, but to allow them to type as fast as possible. Remember that typists use both hands so the distance between character pairs isn't the limiting factor - they press one with the left hand, and one with the right. QWERTY is hard on hunt-and-peck typists though :D

I used to enjoy typing (badly) on this kind of machine when I was much much younger, I wonder if my learned-on-computer touch-typing would still apply now?

Will
« Last Edit: February 12, 2012, 10:30:44 PM by Will Vale » Logged
EdgeOfProphecy
Level 2
**



View Profile WWW Email
« Reply #139 on: February 13, 2012, 12:22:45 AM »

to clarify, i never said the industry is always wrong, just that they can be wrong, and that the industry tends to fund research on small incremental improvements to existing technology, not radical departures, because let's say someone created a 10-base computer. one which could perfectly represent 0.1 without imprecision. who would buy it? who could code for it? nobody, it'd be pointless to create such a thing -- not because there's anything wrong with it, but because it'd be incompatible with everything else

also your base 2 vs base 10 thing is exactly what i was saying. let's say you tell the computer to store the value of 0.1. it would store it internally imprecisely, as steed and bobo mentioned above. in binary, it's stored as 0.000110011... as 1/16 + 1/32 + 1/256 + 1/512... it's an imprecise translation from base 10 to base 2. so computers using binary is *exactly* why they can't precisely store a value of 0.1

ternary computer is different from an analog computer -- analog is a scale, ternary is a bit which can be 0, 1, or -1. the ternary computer mentioned wasn't an analog computer, it was a digital one, it was just base-3 digital instead of base-2 digital

(Obligatory I'm not a EE disclaimer)

They did indeed experiment around with non-binary computers, but the technology for making them is cumbersome, especially as they miniaturize.

Data's represented by electrical charge.  In order to have, say, 10 different values be represented, you'd need 10 different, distinct charges.  Binary, on the other hand, only needs two, "A lot" and "Very little" to represent 1 and 0.  Come to find out, since we have physics to worry about, it's very hard to hold exactly precise levels of charge in computational circuits, so non-binary systems are more error prone.  A program can go very wonky if 5 suddenly becomes 6.  As parts miniaturize, it becomes even harder to hold precise charges, making binary a more attractive option.

At present chip manufacturers struggle constantly with getting transistors that can reliably represent just binary data.  As transistors shrink, we're down to what, 22nm now or something, so does the amount of material that's available to hold charge.  Intel made a big deal out of figuring out how to manufacture "3D transistors", because it allowed them to increase the surface area of the gate, and thus increase its reliability within the same physical footprint.
Logged
st33d
Guest
« Reply #140 on: February 13, 2012, 02:40:55 AM »

I'm waiting for neural net architecture personally.

I studied it loads on my degree with the disappointing conclusion that traditional computers can't simulate them adequately.

Number representation would be pretty funny. "Hrmm, I think it's a number 2. Probably not worth worrying too much about."
Logged
J-Snake
Level 10
*****



View Profile WWW Email
« Reply #141 on: February 13, 2012, 05:50:25 AM »

I'm waiting for neural net architecture personally.
I want to see your opinion after you have made a complete game on it, if you ever manage it.
Logged
Painting
Level 2
**


View Profile
« Reply #142 on: February 14, 2012, 01:20:18 AM »

also, superior technologies don't always win out, sometimes inferior ones can win due to other factors. one classic example of this is VHS vs 8-track, which you're probably familiar with. there are countless more examples like that throughout history. could not ternary vs binary computers be a similar case?

This feels like a very basic thing to have to explain, but there's never been a "VHS vs 8-track".
Logged
xrabohrok
Level 0
***


ahahahaAHAHAHAAHA


View Profile WWW Email
« Reply #143 on: February 14, 2012, 09:08:11 AM »

There was a "VHS vs. Laserdisk" though, and VHS won that somehow*  Wink

*VHSs weren't 50 1980's dollars each.

It's all about the monies. 
Logged

A picture is worth a 1000 words, so naturally they save a lot of time.
Mikademus
Level 10
*****


The Magical Owl


View Profile
« Reply #144 on: February 14, 2012, 09:09:27 AM »

to clarify, i never said that it was exclusively between VHS and 8-track, I know the actual case was between VHS and Betamax, I just used VHS and 8-track as examples that the industry tends to fund research on small incremental improvements to existing technology and that the best or most economic technology doesn't always win.

Quoting Paul's reply before he actually replies. Because my mind is a time machine.
Logged

\\\"There\\\'s a tendency among the press to attribute the creation of a game to a single person,\\\" says Warren Spector, creator of Thief and Deus Ex. --IGN<br />My compilation of game engines for indies
Christian Knudsen
Level 10
*****



View Profile WWW Email
« Reply #145 on: February 14, 2012, 11:13:16 AM »

There was a "VHS vs. Laserdisk" though, and VHS won that somehow*  Wink

*VHSs weren't 50 1980's dollars each.

It's all about the monies. 

LaserDisc was never really a competitor to VHS. You used VHS tapes for recording just as much as for renting movies. LaserDiscs couldn't record. Also, I wouldn't say that LaserDisc lost -- it was the precursor for CDs, DVDs, and so on, so in a sense, it has outlived VHS.
Logged

Laserbrain Studios
Currently working on Hostile Takeover (TIGSource DevLog)
mduffor
Level 0
**



View Profile WWW Email
« Reply #146 on: February 14, 2012, 12:31:36 PM »

also, superior technologies don't always win out, sometimes inferior ones can win due to other factors. one classic example of this is VHS vs 8-track, which you're probably familiar with. there are countless more examples like that throughout history. could not ternary vs binary computers be a similar case?

This feels like a very basic thing to have to explain, but there's never been a "VHS vs 8-track".

It was VHS vs BetaMax.  8-tracks were a portable (playback only) version of reel-to-reel audio tapes and started to replace vinyl records as well.  Cassette tapes replaced the 8-track and really killed off vinyl sales.  The CD replaced them all.  CDs have been largely replaced by digital

Geez, am I one of the only ones here old enough to have witnessed all of this?  Get off my lawn!   My Word!

Cheers,
Michael

Logged

Blog + website = www.mduffor.com
Average Software
Level 10
*****

Fleeing all W'rkncacnter


View Profile WWW Email
« Reply #147 on: February 14, 2012, 12:33:53 PM »

CDs have been largely replaced by digital.

That's quite a trick, considering that CDs are digital.
Logged

Franchise - The restaurant wars begin!

What would John Carmack do?
Nix
Level 10
*****



View Profile
« Reply #148 on: February 14, 2012, 06:42:03 PM »

Should be: "CDs have largely been replaced by flash"
Logged
J-Snake
Level 10
*****



View Profile WWW Email
« Reply #149 on: May 03, 2012, 05:52:45 PM »

I was issued with this topic now for some new upcoming projects. My conclusion so far is that integers sounds nice and consistent. But as soon as it comes to multiplication/division things look not so great for ints. Imagine you have to take the square of some millions and you are already out of 32-bit range.

But the properties of float-representation have some ugly sideeffects for games. It doesn't matter you scale the borders of your game to 1.0f or to 1000000.0f. You will have the same resolution-distribution almost everywhere what is right in front of your feet, only very close things are treated with an extremely higher resolution. So when it comes to games I would prefer to get rid of the negative exponent and spend this bit to give the mantissa double the resolution.

Also in scientific computations you are interested in the relative error which is fine. But in games it is also about the absolute values, like position and not only the distance. The distance of two equally shifted positions is not always equal.

If you have a possible solution how to deal with ints I am all ears!
Logged
Pages: 1 ... 8 9 [10] 11 12
Print
Jump to:  

Theme orange-lt created by panic