### Author Topic: How to convert floating points to integers  (Read 1263 times)

0 Members and 1 Guest are viewing this topic.

#### rainer

• SMSC winner
• Posts: 100
##### How to convert floating points to integers
« on: April 25, 2011, 04:38:25 PM »
Dedicated[0] to all friends who do not know what is happening in #simutrans at irc.quakenet.org, I would like to quote a wonderful example how people are helping each other by using IRC. The problem is briefly described in the topic.[1]

Quote
<jamespetts> Hello.
<rainer> Gooooooood afternoon!
<jamespetts> How are you?
<rainer>Not.
<jamespetts> Not?
<rainer> I am not.
<jamespetts> Not what...?
<rainer> . o O (I see question marks over his head...)
<rainer> Everything.
<jamespetts> You are not everything? Nobody is everything.
<jamespetts> But everybody is something.
<rainer> Now you got it!
<jamespetts> Well, nobody is nothing.
<jamespetts> I know because I saw nobody last week and he told me.
<rainer> I am not nobody. I am just not. As a condition, not as an entity.
<jamespetts> I met you and you didn't tell me?
<rainer> Yes, indeed. I haven't told you that I met you.
<jamespetts> That is a shame, or else I'd have said hello.
<jamespetts> Do you like squirrels in the sunshine?
<rainer> I didn't told you that I have met you because I haven't met you.
<rainer> I do like parrots in a cave.
<jamespetts> I've never seen parrots in a cave.
<rainer> That's why.
<jamespetts> You like things that I've never seen?
<rainer> It depends. Caves are dark. That might be a hint for the reason.
<jamespetts> You must, then, have a great fondness for the dark side of the moon.
<jamespetts> But, tell me: if you were a parrot, would you want to be liked in a cave?
<rainer> If I would be a parrot, and you would sit in front of the cave, I would prefer the cave.
<jamespetts> And if you were an Owl and a Pussycat, and had before you a pea green boat?
<rainer> Interesting testing environment. In this case I presume I would ask someone of the Monty Python Team.
<jamespetts> That may be wise.
<jamespetts> Incidentally - do you have any idea how to convert physics equations from floating point to integer...?
<rainer> Hm... <thinking>
<rainer> </thinking>
<rainer> Ever tried blowing on them?
<jamespetts> I must confess, I have not. Does that normally work?
<rainer> It's worth a try, isn't it?
<jamespetts> I suppose that anything is worth a try...
<rainer> So - why not blowing?
* jamespetts blows on physics equations.
<jamespetts> They still appear to be floating point.
<rainer> In what kind of liquid does the point float?
<jamespetts> I would have to conduct spectrographic analysis to find out.
<rainer> Or ask the parrot! If he starts to drink it, it might be water.
<rainer> Or whiskey.
<jamespetts> Do parrots like whiskey?
<rainer> Why shouldn't they not like?
<jamespetts> I suppose if bluebirds like milk, anything is possible.
<rainer> So, if you know the liquid's details, you might increase the density of the points, until the liquid is no liquid anymore.
<rainer> No liquid, no way to float.
<jamespetts> And no pesky parrots drinking it?
<rainer> Well, the worst case is that the parrot will eat the equations.
<jamespetts> Ahh. That must be avoided. I think that some of the equations have already been eaten, albeit more likely by marauding squirrels than parrots.
<rainer> Hm.
<jamespetts> I must distract them with acorns.
<steffen123> i love squirrels
<jamespetts> Who wouldn't?
<rainer> If you miss some equations, they might have eliminated themselves by mathematic methods.
<rainer> I still recommend to ask the parrot for help. Maybe he will defend the equations against the squirrels.
<jamespetts> That is an interesting idea. Perhaps whilst the parrots are fending off the squirrel attack, I can take the liquid whilst they're not looking.
<rainer> That's worth a try. That might lead to the result you want: parrot and squirrel are busy, the liquid is gone, no way to float, so you will get integer.
<jamespetts> I must confess, I never thought that the answer to my coding problems would be solved by means involving a war between parrots and squirrels.
<rainer> War? Be careful! What is to be done, if squirrels and parrots form a coalition?
<jamespetts> Then I send in the cat mercenaries.
<jamespetts> And ready the starling airstrikes.
<rainer> Oh! I would like to recommend wholeheartely to avoid getting a cat involved. In this case you can forget all your physic equations.
<rainer> Cats are designed to ignore physical laws.
<rainer> Gravitaion, i.e.
<jamespetts> Ahh, but if they ignore them they won't interfere with my equations, surely?
<jamespetts> And they come with eight free backups.
<rainer> No! They hate that laws. They will attack your equations. Quite effectively.
<jamespetts> Surely they'd rather attack parrots? - Especially drunk parrots.
<rainer> ...assuming the liquid is whiskey - which is not proofed so far.
<jamespetts> Well, we'd find out when the parrots drink it, and we'd see if they remain quick-witted enough to escape the cats.
<rainer> I still think the method to be tested first is throwing more and more points into the equation. Whenever there is no space left for floating, an integer should be generated.
<jamespetts> Ahh - you may have a point there.
<rainer> Ah! No! It is _not me_ to get all the points!
<jamespetts> Perhaps if I gave you all my points, I'd have integer equations?
* jamespetts points at rainer.
<rainer> I am not crazy! I won't accept the points!
<rainer> I need liquid. Floating. With or without points.
<jamespetts> Are you sure about not being crazy?
<rainer> According to the parrot: Yes.
<rainer> "If things are going crazy, the lunatics will be the experts."