Counterglow Forums  

Go Back   Counterglow Forums > General Discussions > Technoglow

Reply
 
Thread Tools Display Modes
Old 16-03-2006, 08:02:46   #1
JM^3
colossal bender
 
JM^3's Avatar
 
Join Date: Jul 2003
Location: In front of my computer
Programming Help

Hmm... I have problems again

Is there any good way to change double to int?

I guess my other concerns are probably inherent to ROOT http://root.cern.ch/root/html/src/TS...#TString:Strip

JM
__________________
The G in Greg stands for Gaylord.
JM^3 is offline   Reply With Quote
Old 16-03-2006, 08:06:34   #2
JM^3
colossal bender
 
JM^3's Avatar
 
Join Date: Jul 2003
Location: In front of my computer
http://root.cern.ch/root/html/TTree.html#TTreeraw

current problem relates to this, I think

JM
__________________
The G in Greg stands for Gaylord.
JM^3 is offline   Reply With Quote
Old 16-03-2006, 08:09:41   #3
Asher
Token Black Guy & Yank of the Year
 
Asher's Avatar
 
Join Date: Apr 2002
Location: Birminghamshire upon Avon, UK
double to int?

Can't you just round it? Or using ceil/floor...
__________________
The internets are serious business.
Death Threat Counter: 1
Asher is offline   Reply With Quote
Old 16-03-2006, 08:14:24   #4
JM^3
colossal bender
 
JM^3's Avatar
 
Join Date: Jul 2003
Location: In front of my computer
floor/ceil still have double as output...

JM
(at least, that is what I read)
__________________
The G in Greg stands for Gaylord.
JM^3 is offline   Reply With Quote
Old 16-03-2006, 08:14:56   #5
JM^3
colossal bender
 
JM^3's Avatar
 
Join Date: Jul 2003
Location: In front of my computer
I am pretty sure that it si the problem with Draw that is crashing my program though

JM
__________________
The G in Greg stands for Gaylord.
JM^3 is offline   Reply With Quote
Old 16-03-2006, 08:16:26   #6
Asher
Token Black Guy & Yank of the Year
 
Asher's Avatar
 
Join Date: Apr 2002
Location: Birminghamshire upon Avon, UK
Did you try typecasting it?

eg...
Code:
double penetration;

int awesome = (int)penetration;
__________________
The internets are serious business.
Death Threat Counter: 1
Asher is offline   Reply With Quote
Old 16-03-2006, 08:17:35   #7
Asher
Token Black Guy & Yank of the Year
 
Asher's Avatar
 
Join Date: Apr 2002
Location: Birminghamshire upon Avon, UK
In C++ I think the behavior when doing a double->int typecast is a floor, by the way.
__________________
The internets are serious business.
Death Threat Counter: 1
Asher is offline   Reply With Quote
Old 16-03-2006, 08:43:02   #8
JM^3
colossal bender
 
JM^3's Avatar
 
Join Date: Jul 2003
Location: In front of my computer
hmm, I have

double penetration;

int awesome = penetration;

JM
__________________
The G in Greg stands for Gaylord.
JM^3 is offline   Reply With Quote
Old 16-03-2006, 08:47:13   #9
Asher
Token Black Guy & Yank of the Year
 
Asher's Avatar
 
Join Date: Apr 2002
Location: Birminghamshire upon Avon, UK
Add the (int) part
__________________
The internets are serious business.
Death Threat Counter: 1
Asher is offline   Reply With Quote
Old 16-03-2006, 09:07:24   #10
Nav
Never gonna be as ugly as Lurker
 
Nav's Avatar
 
Join Date: Nov 2001
Location: Everywhere...
Quote:
Originally posted by JM^3
hmm, I have

double penetration;
Nice, was it fun!?
Nav is offline   Reply With Quote
Old 16-03-2006, 14:23:38   #11
Venom
Look out behind you!
 
Venom's Avatar
 
Join Date: Nov 2001
Location: Rudolph's stable
It's been too long since I've done C++. I don't know if it would work, but wouldn't the easiest way be to just set the double equal to an int type variable? Or does that error in C++?

I don't remember. It's been 7 years since I used C++.
__________________
TO MY BALLS!!!!!
or
TO LazyView!!!!

Venom is offline   Reply With Quote
Old 16-03-2006, 14:25:19   #12
King_Ghidra
pedicabo ego vos et irrumabo
 
King_Ghidra's Avatar
 
Join Date: Nov 2001
Location: MORAL HARDCORE CHAMPION
Quote:
Originally posted by Nav
Nice, was it fun!?
Quote:
Originally posted by JM^3
awesome = penetration
__________________
i check my hair at the elevator mirror and the highlight of my day when I say hi to a girl who's opposite of the elevator door at my floor. the one i went out with.
after that, it's the same old fucking thing all over again.
-paiktis
King_Ghidra is offline   Reply With Quote
Old 16-03-2006, 18:55:26   #13
mr.G
jesjes inderdeed
 
mr.G's Avatar
 
Join Date: Apr 2005
Location: tralalalacity
thanks phill, i would have missed that.
__________________
this is a "Mr. G scares the hell out of CG with intelligent on-topic posts" thread : MDA
mr. G? annoying? nevah! : Japher
I think that Mr. G is right. : Sir Penguin
i wanna be mrG's best friendje : Vincent

mr.G is offline   Reply With Quote
Reply
Forum Jump

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 07:19:28.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© Counterglow 2001-2012. All rights reserved.